Average
#include
#include
int x,grade,ave,a,b,c;
void main(){
clrscr();
printf("Enter grade, -1 to exit:");
scanf("%d",&a); printf("Enter grade, -1 to exit:");
scanf("%d",&b); printf("Enter grade, -1 to exit:");
scanf("%d",&c);
grade=a+b+c;
ave=grade/3;
printf("average is:%d",ave);
if(ave<=9) printf("\ninvalid input"); while (ave>=95)
printf("");
getch(); }
#include
#include
int x,grade,ave,a,b,c;
void main(){
clrscr();
printf("Enter grade, -1 to exit:");
scanf("%d",&a); printf("Enter grade, -1 to exit:");
scanf("%d",&b); printf("Enter grade, -1 to exit:");
scanf("%d",&c);
grade=a+b+c;
ave=grade/3;
printf("average is:%d",ave);
if(ave<=9) printf("\ninvalid input"); while (ave>=95)
printf("");
getch(); }
No comments:
Post a Comment