Advertisement

First u have to enter ten student mark.this will calculate lowest mark, highest mark, mean mark::

#include<conio.h>
#include<stdio.h>
void main()
{clrscr();
int a[10],i,n,m;
float b;
printf("enter the numbers of 10 students");
n=1;
for(i=0;i<=9;i++)
{printf("\n %d.",n);
scanf("%d",&a[i]);
n++;}
n=1;
for(i=0;i<=9;i++)
{printf("\n %d.",n);
printf("%d",a[i]);
n++;}
printf("\n \n calculation of highest marks");
m=a[0];
for(i=0;i<=9;i++)
{if(m<a[i])
m=a[i];}
printf("\n %d",m);
printf("\n \n calculation for lowest marks");
m=a[0];
for(i=0;i<=10;i++)
{if(m>a[i])
m=a[i];}
printf("\n %d",m);
printf("\n \n calculation of mean of the marks");
m=0;
for(i=0;i<=9;i++)
{m=m+a[i];}
b=m/10;
printf("\n %f",b);
getch();}

No comments:

Post a Comment

Please comment bellow. Share your knowledge