Code C ++ หาเกรดเฉลี่ย

#include
#include
void main()
{
float a,b,ab=0,sum=0,j=0;
clrscr();
do
{
printf(“Grade : “,a);
scanf(“%f”,&a);
printf(“Credit : “,b);
scanf(“%f”,&b);
ab=a*b;
sum=sum+ab;
j=j+b;
}
while(a!=0);
printf(“Average of Grade : %.2fn”,sum/j);
getch();
}

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

%d bloggers like this: