Sunday, 14 July 2013

write a program to find the largest number between three numbers



  #include<stdio.h>


int main ()
{
    int a,b,c;
   
    printf("enter three number\n");
     scanf("%d%d%d", &a , &b , &c);
     printf("A = %d \nB =%d \nC = %d \n " , a ,b ,c );
   
     if(a>b)
     {
        if(a>b)
     
       {
       printf("a is greater\n");
       }
       else
       {
           printf("c is greater\n");
           }
           }
           else
           {
               if (b<c)
               {
                       printf("b is greater\n");
                       }
                       else
                       {
                           prentf("c is greater\n");
                           }
                           }
                           gatch();
                           return 0;
                         
                           

No comments:

Post a Comment