1.

Write a program in basic to calculate the average of three numbers

Answer»

Explanation:

C program to CALCULATE SUM and average of three numbers:

#include

int main () {

int a, b, c;

printf("Enter three numbers: ");

scanf("%d %d %d", &a, &b, &c);

int sum = a + b + c;

FLOAT AVG = sum / 3.0;

printf("Sum = %d, Average = %f", sum, avg);



Discussion

No Comment Found