::ภาษาC::...++โปรแกรมเกรดเฉลี่ยแบบวนลูปจร้า โดยใช้ Do-While++...
<<<หาเกรดเฉลี่ยเท่าไร่ก็ได้ ถ้าจะหยุดใส่ให้ใส่ตรงเกรดเป็นเลข 0>>>
#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 : %.2f\n",sum/j); getch(); }
Create Date : 07 กุมภาพันธ์ 2551 |
Last Update : 7 กุมภาพันธ์ 2551 14:12:19 น. |
|
0 comments
|
Counter : 4135 Pageviews. |
|
|
|
|
|