#include< stdio.h >
#include< conio.h >
void main()
{
int num1,num2,num3;
void avg (int a, int b, int c);
clrscr();
printf("Enter three numbers:");
scanf("\n%d \n%d\n %d",&num1,&num2,&num3);
avg(num1,num2,num3);
getch();
}
void avg (int a, int b, int c)
{
float avgg;
avg=(a+b+c)/3.0;
printf("Average of given numbers is=%f",avgg);
}
OUTPUT :
Enter three numbers:
5
8
6
Average of given numbers is=19
#include< conio.h >
void main()
{
int num1,num2,num3;
void avg (int a, int b, int c);
clrscr();
printf("Enter three numbers:");
scanf("\n%d \n%d\n %d",&num1,&num2,&num3);
avg(num1,num2,num3);
getch();
}
void avg (int a, int b, int c)
{
float avgg;
avg=(a+b+c)/3.0;
printf("Average of given numbers is=%f",avgg);
}
OUTPUT :
Enter three numbers:
5
8
6
Average of given numbers is=19
No comments :
Post a Comment