simple program using array


//simple program using array

#include<stdio.h>
#include<conio.h>
void main()
{
 int i,sum,marks[5];
 float avg;
 printf("Enter marks one by one");
 for(i=0;i<5;i++)
 {
  scanf("%d",&marks[i]);
 }

 for(i=0;i<5;i++)
 {
  sum+=marks[i];
  avg=sum/5;
  printf("Average marks = %f\n",avg);
 }

getch();
}

Post a Comment

Previous Post Next Post