Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

HackerEarth Survey Analysis problem solution

YASH PAL, 31 July 202410 February 2026
In this HackerEarth Survey Analysis problem solution, WebEngage empowers companies to collect feedback and gather insights from visitors using surveys and notifications.
 
An e-commerce company used the WebEngage customer engagement tool to ask visitors if they want to buy the selected products at discounted prices. If the visitor said ‘Yes, the product was delivered to the customer at a discounted price. They collected the response for a whole week from Monday to Sunday. Now they want to analyze which day most of the people said ‘Yes’ compared to other days. For this, they want to calculate the standard deviation of the ‘Yes’ count on each day. Using the standard deviation, we have a standard way of knowing which day was extra good, which day was extra bad, and which day was just plain normal in terms of business.
 
 
HackerEarth Survey Analysis problem solution

 

 

HackerEarth Survey Analysis problem solution.

#include <bits/stdc++.h>
using namespace std;
double days [7 + 10];

int main()
{

int n;
double sum = 0, day = 0, average, var = 0, standard_Deviation;

string s;

for(int i = 0; i < 7; i++){

cin >> s;
day = 0;

for(int j = 0; j < s.size(); j++){

if(s[j] == '1') days[i]++;
}

sum += days[i];
}

average = sum / 7.0;

for(int i = 0; i < 7; i++){

var += (average - days[i]) * (average - days[i]);
}

standard_Deviation = sqrt(var / 7.0);

printf("%.4lfn", standard_Deviation);

return 0;
}
 
coding problems solutions

Post navigation

Previous post
Next post

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes