The bugs are for you to find! I'm wired in! Are you?
#include<stdio.h> #include<conio.h> main() { int n,c=1; float x,avg,sum=0; printf("How many numbers?\n"); scanf("%d",&n); do{ printf("x= "); scanf("%f",&x); sum=sum+x; ++c; }while(c<=n); avg=sum/n; printf("The average is %f\n",avg); getch(); }
No comments:
Post a Comment