#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e,f,g;
cout<<"Enter 5 nos. ";
cin>>a>>b>>c>>d>>e;
f=(a+b+c+d+e)/5;
cout<<"Average of these nos. = "<<f<<"\n";
if (a>f){cout<<a<<" is greater than average no."<<"\n";}
if (b>f){cout<<b<<" is greater than average no."<<"\n";}
if (c>f){cout<<c<<" is greater than average no."<<"\n";}
if (d>f){cout<<d<<" is greater than average no."<<"\n";}
if (e>f){cout<<e<<" is greater than average no."<<"\n";}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e,f,g;
cout<<"Enter 5 nos. ";
cin>>a>>b>>c>>d>>e;
f=(a+b+c+d+e)/5;
cout<<"Average of these nos. = "<<f<<"\n";
if (a>f){cout<<a<<" is greater than average no."<<"\n";}
if (b>f){cout<<b<<" is greater than average no."<<"\n";}
if (c>f){cout<<c<<" is greater than average no."<<"\n";}
if (d>f){cout<<d<<" is greater than average no."<<"\n";}
if (e>f){cout<<e<<" is greater than average no."<<"\n";}
getch();
}
No comments:
Post a Comment