Thursday, 8 January 2015

C Program To Find Maximum of Two Numbers

/* Maximum of two number in c */

For any query regarding c/c++ feel free to contact me on khimanichirag@gmail.com or comment below. I try my best to solve it.

 #include<stdio.h>  
 #include<conio.h>  
 void main()  
 {  
   clrscr();  
   printf("Enter the value of first number: ");  
   scanf("%d",&n1);  
   printf("Enter the value of second number: ");  
   scanf("%d",&n2);  
   if(n1>n2)  
   {  
     printf("%d is maximum",n1);        
   }  
   else  
   {  
     printf("%d is maximum",n2)  
   }    
   getch();  
 }  

No comments:

Post a Comment