February 13, 2011

C Program to find Maximum of 3 nos. using Nested if


/*C Program to find Maximum of 3 nos. using Nested if*/
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c;
// clrscr();
 printf("Enter three number\n\n");
 scanf("%d%d%d",&a,&b,&c);
  if(a>b)
  {
    if(a>c)
   {
     printf("\n a is maximum");
   }
   else
   {
     printf("\n c is maximum");
   }
   }
   else
   {
   if(b>c)
   {
   printf("\n b is maximum");
   }
   else
   {
   printf("\n c is maximum");
   }
   }
   getch();
   }


Hope you liked my posts, give comments if you have any doubts.. :)

Related Posts :



Categories:

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Related Posts with Thumbnails