Ex. ภาษาซี Loop For

#include<stdio.h>
main ()
{
float first,second,sum=0,sumf=0,sums=0,average;
int N;
for (N=1;N<=10;N++)
{
printf(“Enter two number “);
scanf(“%f%f”,&first,&second);
sum = first+second;
average = sum/2;
sumf=sumf+first;
sums=sums+second;

printf(“Average %.1f\n”,average);
}
printf(“total first number is %.1f\n”,sumf);
printf(“total second numver is %.1f\n”,sums);
}

Leave a Reply

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 / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s