answersLogoWhite

0


Best Answer

/*mycfiles.wordpress.com

To Calculate Sum & Average of 4 no.*/

#include<stdio.h>

#include<conio.h>

void main()

{

float a,b,c,d,sum,avg;

clrscr();

printf("Enter the 4 nos.\n\n");

scanf("%f%f%f%f",&a,&b,&c,&d);

sum=a+b+c+d;

avg=(a+b+c+d)/4;

printf("\nSum is= %f\nAverage is= %f",sum,avg);

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to calculate sum and average of 4 numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to calculate the sum of two numbers in unix?

$vi sum.sh echo "enter the 1st no." read num1 echo "enter the 2nd no." read num2 sum= 'expr $num1 + $num2' echo "sum of the numbers is $sum"


How to calculate?

You can calculate the sum of numbers by adding numbers together. You can calculate the product of numbers by multiplying those numbers.


How do you find the average of fractions?

The same way that you calculate the average for any other numbers. Sum the fractions and divide the total by the number of fractions.


How do you calculate the average of 5 numbers?

1)start 2)input 5 numbers m,a,i,r,a 3)average=sum/5 4)printsum 5)stop


What is the average of 8 numbers if their sum is 2464?

The mean average of a set of numbers is the sum of the numbers divided by how many of them there are. If there are 8 numbers with a sum of 2464, their mean average is 2464 &divide; 8 = 308.


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end


How do you find the sum of five numbers if the average of the five numbers is 790.6?

The average of a group of numbers is equal to the sum of the numbers divided by the number of numbers. If you want to find the sum of the five numbers, just multiply 790.6 by 5 to get the sum, which is 3953


If the sum of four numbers is 14.8 what is the average of the four numbers?

The average, in this case, is the sum divided by 4 (since there are 4 numbers).


What is the average of 16 and 40?

The average of a series of numbers is their sum divided by however many numbers there are: in this case you would calculate: (16 + 40) / 2 =56 / 2 =28 Therefore the average of 16 and 40 is 28.


Program to calculate the sum of first ten natural numbers?

Algorithm to find the sum of first n natural numbers:1. Read n.2. Initialize N=1.3. Initialize sum S=0.4. Calculate S=S+N.5. Calculate N=N+1.6. If N>n, then goto step 7 else goto step 4.7. Write the sum S.8. Stop.


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


To calculate sum of 2 numbers?

The sum of two numbers is the result of multiplying those numbers together. It can also be referred to as repetitive addition.