Powered by Blogger.

Search

Saturday, 13 December 2014

Programme that stops at entering -99 and print maximum value




//This programme is tested on visual studio 2012//
#include <iostream>

using namespace std;

void main()

{

unsigned int a, max=0;
cout<<"------------------------------------------------------------------------------\n";
cout<<"This programme will input integers and print maximum number on entering -99\n";
cout<<"------------------------------------------------------------------------------\n";
cout<<"Enter number \n";

cin>>a;

while (a!=-99)

{

while (max<a)

{

max=a;

}

cout<<"Enter number\n";

cin>>a;

}

cout<<"The Greatest number is = "<<max;
cout<<"\n\n------------------------------------------------------------------------------\n";
    cout<<"Thank You for using.\n\nVisit http://bilalzahid22.blogspot.com/ for more\n";
  cout<<"\n------------------------------------------------------------------------------\n";


}

Ditulis Oleh : Unknown // 02:28
Kategori:

0 comments:

Post a Comment

Translate