A structured program to find average of 5 subject with C LANGUAGE:-
//CODE BY ALI RAZA
//VIST: LORDOSOFTWARES.BLOGSPOT.IN
//FOR FREE SOFTWARES AND MORE CODE
// REQUEST AND GET CODES FOR FREE
#include<stdio.h>
#include<conio.h>
int main()
float avg(int);
{
int x,y=0,z=0;
for(x=1;x<5;x++)
{
printf("enter num of sub%d:",x);
scanf("%d",&y);
z=z+y;
}
printf("toal=%d",z);
avg(z);
getch();
}
float avg(int m)
{
int z;
float y;
printf("enter total num:");
scanf("%d",&z);
y=m*100/z;
printf("%f",y);
return y;
}
No comments:
Post a Comment