BCA

C PROGRAMMING LAB

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10 PROGRAM 11 PROGRAM 12

Program to find the biggest and the smallest among 4 numbers using nested if

#include< stdio.h >
main()
{
       int a,b,c,d;
       clrscr();
       printf("Enter the Four Numbers :");
       scanf("%d %d %d %d",&a,&b,&c,&d);
       if(a > b)
        {
             if(a >c)
              {
                 if(a >d)
                  {  
                     printf("%d is big",a);
                   }
                 else
                  {
                     printf("%d is big",d);
                   }
               }
          }
              else if(b >c)
                      {
                           if(b > d)
                             {
                                 printf("%d is big",b);
                              }
                            else
                             {
                                 printf("%d is big",d);
                             }
                       }
               else if(c > d)
                      {
                             printf("%d is big",c);
                       }
              else
               {
                    printf("%d is big",d);
               }
                    getch();
}

Greatest Between Four Number