Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main ()
- {
- int total_no, count = 1;
- float number, average, sum =0;
- printf("How many numbers? ");
- scanf("%d", &total_no);
- do{
- printf("Enter number %d : ", count);
- scanf("%f", &number);
- sum +=number;
- count++;
- }while (count <=total_no);
- average = sum / total_no;
- printf("Average is : %f\n", average);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement