#include <iostream>
using namespace std;
main()
{
int N,Num,Sum=0,avg;
cout<<"Enter the Number of Numbers\n";
cin>>N;
for(int i=1;i<=N;i++)
{
cout<<"Enter a Number\n";
cin>>Num;
Sum=Sum+Num;
}
avg=Sum/N;
cout<<"Sum= "<<Sum<<"\n"<<"Average= "<<avg;
}
#include <iostream>
using namespace std;
main()
{
int N,Num,Sum=0,avg;
cout<<"Enter the Number of Numbers\n";
cin>>N;
for(int i=1;i<=N;i++)
{
cout<<"Enter a Number\n";
cin>>Num;
Sum=Sum+Num;
}
avg=Sum/N;
cout<<"Sum= "<<Sum<<"\n"<<"Average= "<<avg;
}
//Java Program to count the total number of characters in a string import java.util.*; public class CountChars { public static void mai...
No comments:
Post a Comment