SUM AND AVERAGE OF THREE NUMBERS - C PROGRAMMING - Code Developer Pro

magma

Solutions to all coding problems

Like us on Facebook

demo-image

Post Top Ad

Responsive Ads Here

Post Top Ad

Thursday, 17 December 2015

SUM AND AVERAGE OF THREE NUMBERS - C PROGRAMMING

Responsive Ads Here
c
How to find the sum and average of three numbers in a c program?

Solution


#include<stdio.h>
void main()
{
      system("clear");
      float a,b,c,ave,sum;
      printf("enter the 3 numbers");
      scanf("%f%f%f",&a,&b,&c);
      sum=a+b+c;
      ave=(a+b+c)/3;
      printf("the sum is %f",sum);
      printf("\nthe average is %f",ave);
}

Thanks & Regards,
Anju Soosan George
Assistant Professor

No comments:

Post a Comment

Post Top Ad