//pgm to find the largest odd and even numbers from a list of numbers
#include<iostream.h>
#include<conio.h>
void main()
{
int i,x,n,largee,largeo;
clrscr();
cout<<"enter the value of n"<<endl;
cin>>n;
cout<<"enter the numbers";
largee=2;
largeo=1;
for(i=1;i<=n;i++)
{
cin>>x;
if(x%2==0)
{
if(x>largee)
largee=x;
}
else
{
if(x>largeo)
largeo=x;
}
}
cout<<"largee="<<largee<<endl;
cout<<"largeo="<<largeo;
getch();
}
Please Click on ADS!!
Please Click on the above ads given by GOOGLE , so that I can maintain my blog!!
Tuesday, August 31, 2010
Find the largest odd and even numbers from a list of numbers
Posted by
Mukesh
at
8/31/2010 08:35:00 PM
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment