===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int p,o,i;
char l[20],k[20],j[20];
cout<<"\n Enter name and age of Boy 1: ";
cin>>l>>p;
cout<<"\n Enter name and age of Boy 2: ";
cin>>k>>o;
cout<<"\n Enter name and age of boy 3: ";
cin>>j>>i;
if(p>=o && p>=i)
{cout<<"\n"<<l<<" congo! you are the eldest";}
else if(o>=i && o>=p)
{cout<<"\n"<<k<<" congo! you are the eldest";}
else
{cout<<"\n"<<j<<" congo! you are the eldest";}
getch();
}
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int p,o,i;
char l[20],k[20],j[20];
cout<<"\n Enter name and age of Boy 1: ";
cin>>l>>p;
cout<<"\n Enter name and age of Boy 2: ";
cin>>k>>o;
cout<<"\n Enter name and age of boy 3: ";
cin>>j>>i;
if(p>=o && p>=i)
{cout<<"\n"<<l<<" congo! you are the eldest";}
else if(o>=i && o>=p)
{cout<<"\n"<<k<<" congo! you are the eldest";}
else
{cout<<"\n"<<j<<" congo! you are the eldest";}
getch();
}
===========================================================================
No comments:
Post a Comment