Write a c++ program to find the sum and average of 5 numbers
Answers
Answered by
0
Answer:
class sum
{
public static void main(int a,int b,int c,int d,int e);
{
float sum = (a +b+c+d+e);
float avg = (sum/5);
System.out.println("The sum ="+sum);
System.out.println("The avarage ="+avg);
}
}
Explanation:
public class sum
{
public static void main(int a,int b,int c,int d,int e);
{
float sum = (a +b+c+d+e);
float avg = (sum/5);
System.out.println("The sum ="+sum);
System.out.println("The avarage ="+avg);
}
}
Answered by
0
Answer:
#include<iostream.h>
void main ( )
{
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
float avg = (a+b+c+d+e)/5;
cout <<avg;
}
Similar questions