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

Breaking

Code Developer Pro

Solutions to all coding problems

Like us on Facebook

test banner

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Thursday 17 December 2015

SUM AND AVERAGE OF THREE NUMBERS - C PROGRAMMING

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

Responsive Ads Here