google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a c program to demonstrate function with argument and without return type - 2nd puc computer science

Write a c program to demonstrate function with argument and without return type

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                                                                               

Average=5.666667                                                                
Write a c program to demonstrate function with argument and without return type Write a c program to demonstrate function with argument and without return type Reviewed by Vision Academy on December 14, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.