วันจันทร์ที่ 11 กรกฎาคม พ.ศ. 2554

การบ้านข้อที่8

#include<stdio.h>
#include<conio.h>
main()
{
      int i,a,b;
      b=0;
      for(i=1;i<=5;i++)
      {
                       printf("Enter weight %d =",i);
                       scanf("%d",&a);
      b=b+a;
      }
      printf("Summary of Weight = %d",b);
     
      getch();
}     

ไม่มีความคิดเห็น:

แสดงความคิดเห็น