Wednesday, 20 June 2012

how to find maximum number using c++



This is the source code for finding the maximum number
#include<iostream.h>
#include<conio.h>
main()
{
      float a,b,c,max;
      cout<<"enter first value";
      cin>>a;
      cout<<"enter second value";
      cin>>b;
      cout<<"enter third value";
      cin>>c;
      max=a;
      if(max<b)
      max=b;
      if(max<c)
      max=c;
      cout<<"maximum value is:"<<max;
      getch();
      }
End

No comments:

Post a Comment