/*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();
}
Algorithm to find the sum and average of 3 numbers: Start. Input three numbers (let's call them A, B, and C). Calculate the sum (Sum = A + B + C). Calculate the average (Average = Sum / 3). Output the sum and average. End. Flowchart: [Start] &darr; [Input A, B, C] &darr; [Sum = A + B + C] &darr; [Average = Sum / 3] &darr; [Output Sum, Average] &darr; [End]
To write pseudocode that accepts five numbers and displays their sum and average, you can follow these steps: Initialize a variable sum to 0. Loop five times to accept input for each number, adding each to sum. After the loop, calculate the average by dividing sum by 5. Display both the sum and the average. Here’s a simple representation: BEGIN sum = 0 FOR i FROM 1 TO 5 DO INPUT number sum = sum + number END FOR average = sum / 5 OUTPUT "Sum: ", sum OUTPUT "Average: ", average END
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 ÷ 8 = 308.
1.Start Algorithm 2.Enter first number 3.Enter second number 4.Enter third number 5.Enter fourth number 6.Enter fifth number 7.Add five number 8.display five number / 2 9.Display result 10.End Algorithm
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.
To write pseudocode that accepts five numbers and displays their sum and average, you can follow these steps: Initialize a variable sum to 0. Loop five times to accept input for each number, adding each to sum. After the loop, calculate the average by dividing sum by 5. Display both the sum and the average. Here’s a simple representation: BEGIN sum = 0 FOR i FROM 1 TO 5 DO INPUT number sum = sum + number END FOR average = sum / 5 OUTPUT "Sum: ", sum OUTPUT "Average: ", average END
$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"
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 ÷ 8 = 308.
Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end
1.Start Algorithm 2.Enter first number 3.Enter second number 4.Enter third number 5.Enter fourth number 6.Enter fifth number 7.Add five number 8.display five number / 2 9.Display result 10.End Algorithm
1)start 2)input 5 numbers m,a,i,r,a 3)average=sum/5 4)printsum 5)stop
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
You can calculate the sum of numbers by adding numbers together. You can calculate the product of numbers by multiplying those numbers.
The average, in this case, is the sum divided by 4 (since there are 4 numbers).
You calculate the normal average between the two central numbers.You calculate the normal average between the two central numbers.You calculate the normal average between the two central numbers.You calculate the normal average between the two central numbers.
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.
write an assembly language program to find sum of N numbers