Tuesday, 14 October 2014

Write a program that reads 20 characters from the user and prints the upper or lower form of it (as desired). If the user enters a digit or a non-character key the program discards it and reads another character (Your program must not count the wrong input)

Leave a Comment
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");
}


If You Enjoyed This, Take 5 Seconds To Share It