Tuesday, 20 January 2015

Program to read 10 number and print both Max and Min in c++

//Program to read 10 number and print both Max and Min in c++

#include<iostream.h>
#include<conio.h>
void main()
{
 int a,i;
 int max=0;
 int min=0;
 clrscr();
 cin>>a;
 min=a;
 for(i=1;i<=9; )
  {
   if(a>max)
     max=a;
   else if(a<min)
     min=a;
   i++;
   cin>>a;
  }
  cout<<"Max= "<<max;
  cout<<"\nMin= "<<min;
  getch();
}

No comments:

Post a Comment

Read contacts in iOS using Swift with error handling

Just copy and paste the below code Pre-step before pasting the below code Add below line in AppDelegate.swift file below import statement ...