Responsive Advertisement
* Write a Program and Algorithm to find the Average of three Number by using C Program.
Algorithm :
Program :
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,num3,Avg;
clrscr();
printf( "Enter the value of number 1 and number 2 and number 3" );
scanf("%d%d%d",&num1,&num2,&num3);
Avg=(num1+num2+num3)/3;
printf( " Average of three number :: ",Avg);
getch();
}
output
Enter the value of number 1 and number 2 and number 3 = 11 ↲
22 ↲ 33 ↲
Division of two number:: 22
Responsive Advertisement
* Write a Program and Algorithm to find the Average of three Number by using C Program.
Algorithm :
- Start
- Read the value of num1 ,num2,num3 and Avg.
- Enter the value of num1.
- Enter the value of num2.
- Enter the value of num3.
- Calculation, Avg=(num1+num2+num3)/3;
- Print the value of average of three number "Avg".
- Stop.
Program :
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,num3,Avg;
clrscr();
printf( "Enter the value of number 1 and number 2 and number 3" );
scanf("%d%d%d",&num1,&num2,&num3);
Avg=(num1+num2+num3)/3;
printf( " Average of three number :: ",Avg);
getch();
}
output
Enter the value of number 1 and number 2 and number 3 = 11 ↲
22 ↲ 33 ↲
Division of two number:: 22
No comments:
Post a Comment