[My site ]
Main » 2013 » December » 12 » C Programming Sheet - 3
11:25 PM
C Programming Sheet - 3
#include"stdio.h"
main()
{
int i, array[6], x, y;
for(i=0;i<=5;i++){
printf("enter value %d : ", i+1);
scanf("%d", &array[i]);
}
printf("\nyou entered :\n");
for(i=0;i<=5;i++){
printf("%4d", array[i]);
if((i+1)%2==0){
printf("\n");
}
}
printf("the avarage of first row = %d\n", (array[0]+array[1])/2);
printf("the avarage of second row = %d\n", (array[2]+array[3])/2);
printf("the avarage of third row = %d\n", (array[4]+array[5])/2);
getch();
}


Category: C Programming - 1 | Views: 404 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]