===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
int n,i,n1,q;
cout<<"\nEnter how many numbers you want to Enter: ";
cin>>n;
cout<<"\n";
cout<<"\nEnter number 1: ";
cin>>q;
for(i=2;i<=n;i++)
{
cout<<"\nEnter number "<<i<<": ";
cin>>n1;
if(q>=n1)
q=n1;
else if(q<n1)
q=q;
}
cout<<"\n\nThe Smallest of all numbers is: "<<q;
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
int n,i,n1,q;
cout<<"\nEnter how many numbers you want to Enter: ";
cin>>n;
cout<<"\n";
cout<<"\nEnter number 1: ";
cin>>q;
for(i=2;i<=n;i++)
{
cout<<"\nEnter number "<<i<<": ";
cin>>n1;
if(q>=n1)
q=n1;
else if(q<n1)
q=q;
}
cout<<"\n\nThe Smallest of all numbers is: "<<q;
getch();
}
===========================================================================
No comments:
Post a Comment