C Program to calculate Total, average in C | C assignment to calculate total and average
#include#include int main() { int a[5],i,tot=0,avg; clrscr(); for(i=1;i< 6;i++) { printf("enter the marks of subjects"); scanf("%d",&a[i]); tot=tot+a[i]; } printf("total=%d\n",tot); avg=tot/5; printf("average=%d",avg); getch(); return 0; }
No comments:
Post a Comment