Computer Science, asked by sahilbhawar3260, 7 months ago

Write an algorithm to calculate the average of two numbers

Answers

Answered by LeonardEuler
0

Hello !

See the following algorithm bellow in C language and as well an example in the attachment.

#include <stdio.h>

#include <math.h>

int main(void)

{

float number0001, number0002, average;

printf("Please, put the first number :");

scanf("%f",&number0001);

printf("Please, put the second number :");

scanf("%f",&number0002);

average = (number0001 + number0002)/2;

printf("Therefore, the average is %0.4f.",average);

return (0);

}

I hope I have collaborated !

Attachments:
Similar questions