Computer Science, asked by josh9881, 11 months ago

एक फंक्शन लिखिए, जो दो संख्याओं को पढ़कर उनका औसत लौटाता हो।

Answers

Answered by abinash95416
0

Answer:

ask in english I'll give you the answer

Answered by ridhimakh1219
0

एक फंक्शन लिखिए, जो दो संख्याओं को पढ़कर उनका औसत लौटाता हो।

Explanation:

दो संख्याओं का औसत ज्ञात करने का C कार्यक्रम:

#include <stdio.h>

float average(int a, int b){

   return (float)(a+b)/2;

}

int main()

{

   int num1, num2;

   float avg;

   printf("Enter first number: ");

   scanf("%d",&num1);

   printf("Enter second number: ");

   scanf("%d",&num2);

   avg = average(num1, num2);

   printf("Average of %d and %d is: %.2f",num1,num2,avg);

   return 0;

}

Output

Enter first number: 20

Enter second number: 13

Average of 20 and 13 is: 16.50

Similar questions