Code
#include<iostream>
using namespace std;
void main()
{
float numbers;
int greater=0,smaller=0;
for(int i=1;i<=20;i++)
{
cout<<"Please Enter Numbers "<< i <<" = ";
cin>>numbers;
if(numbers<smaller)
greater=numbers;
else
smaller=numbers;
}
cout<<"The Greater = = "<<greater<<endl;
cout<<"The Smaller = = "<<smaller<<endl;
system("pause");
}
#include<iostream>
using namespace std;
void main()
{
float numbers;
int greater=0,smaller=0;
for(int i=1;i<=20;i++)
{
cout<<"Please Enter Numbers "<< i <<" = ";
cin>>numbers;
if(numbers<smaller)
greater=numbers;
else
smaller=numbers;
}
cout<<"The Greater = = "<<greater<<endl;
cout<<"The Smaller = = "<<smaller<<endl;
system("pause");
}
0 Questions:
Post a Comment