function with argument and no return value
Write a c program to demonstrate function with argument and without return type
#include<stdio.h>
#include<conio.h>
void main()
{
void average(int,int,int);
int a,b,c;
clrscr();
printf("Enter three numbers:\n");
scanf("%d%d%d",&a,&b,&c);
average(a,b,c);
getch();
}
void average(int x,int y,int z)
{
float sum,avg;
sum=x+y+z;
avg=sum/3.0;
printf("Average=%f",avg);
}
Output:
Enter three numbers:
8
3
6
No comments: