Question: #include < stdio.h > int main () { /* variable definition: */ int value1,value2,value3,value4,value5,sum; double average; /* Initialize sum */ sum = 0 ; printf(

#include <stdio.h>

int main ()

{

/* variable definition: */

int value1,value2,value3,value4,value5,sum;

double average;

/* Initialize sum */

sum = 0;

printf("Enter an Integer for value1 ");

scanf("%d", &value1);

printf("Enter an Integer for value2 ");

scanf("%d", &value2);

printf("Enter an Integer for value3 ");

scanf("%d", &value3);

printf("Enter an Integer for value4 ");

scanf("%d", &value4);

printf("Enter an Integer for value5 ");

scanf("%d", &value5);

sum = value1 + value2 + value3 + value4 + value5;

average = sum / 5.0;

printf("Sum is: %d " , sum );

printf("Average is: %f " , average);

if (average > 100)

printf("Average is over 100 ");

return 0;

}

Above is the code I need help with not so much as how to use it but why, with every compiler I use today nothing shows me the accurate results I'm suppose to get. even with simple math (adding x and y). I'm suing http://ideone.com and https://repl.it yet nothing compiles the way it's suppose to. Even when I copy or type out the example code above verbatim. Nothing works... Can I get a bit of help or assistance from those two sites?I'm using basic C language.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!