Q:

C PROGRAM TO FIND SUM AND AVERAGE OF GIVEN 3 NUMBERS

0

C PROGRAM TO FIND SUM AND AVERAGE OF GIVEN 3 NUMBERS :

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#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;
 
}

output:

Please enter 3 numbers 4 5 6

Sum is 15

Average is  5.000000

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now