C program to find average of 3 integers ( average of 3 numbers)
#include<stdio.h>
#include<conio.h>
main()
{
int n,s,r,avg;
clrscr();
printf("\nEnter 3 numbers : \t");
scanf("%d%d%d",&n,&s,&r);
avg=(n+s+r)/3;
printf("\nAverage of 3 numbers is: %d ", avg);
getch();
return 0;
}
OUTPUT:
Enter 3 numbers: 15 6 8
Average of 3 numbers is: 9
#include<stdio.h>
#include<conio.h>
main()
{
int n,s,r,avg;
clrscr();
printf("\nEnter 3 numbers : \t");
scanf("%d%d%d",&n,&s,&r);
avg=(n+s+r)/3;
printf("\nAverage of 3 numbers is: %d ", avg);
getch();
return 0;
}
OUTPUT:
Enter 3 numbers: 15 6 8
Average of 3 numbers is: 9
0 comments:
Post a Comment