C program to find sum and average of given 3 numbers :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#include<stdio.h> int main() { int a,b,c, sum; float d; printf("Please enter 3 numbers"); scanf("%d%d%d",&a,&b,&c); sum=a+b+c; d=(a+b+c)/3; printf("\nSum is %d", sum); printf("\nAverage is %f",d); return 0; } |