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();
|
|
Total comments: 0 | |