#include<stdio.h>
#include<stdlib.h>
void main()
{
double count = 0;
int input = 0;
int sum = 0;
float average=0;
while ( count < 20)
{
printf("Please enter integer number : ");
scanf_s("%d" , &input);
sum = sum + input;
count = count++;
}
average = sum / count;
printf("The total sum is :%d\n" , sum);
printf("The average of values entered is :%g\n", average);
system("pause");
}
kmlila
0
Newbie Poster
Recommended Answers
Jump to PostI think your question needs to be less vague.
And as always use CODE TAGS it tends to get you more help if people can read your code.
Jump to PostThe only way to find out how many times you executed the program is to write a value to a file or the registry. Programs can not retain values from one instance to another.
Jump to Postuse a counter for each task
All 11 Replies
frogboy77
73
Posting Pro in Training
kmlila
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
kmlila
0
Newbie Poster
zeroliken
79
Nearly a Posting Virtuoso
kmlila
0
Newbie Poster
zeroliken
79
Nearly a Posting Virtuoso
kmlila
0
Newbie Poster
zeroliken
79
Nearly a Posting Virtuoso
kmlila
0
Newbie Poster
kmlila
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.