Friday, May 10, 2013

Find The Maximum Value Of Four Number

    /* Find The Maximum Value Of Four Number */
    /* Suchetan Dey */
   
    #include<stdio.h>
    #include<conio.h>
    void main()
      {
         float a,b,c,d;
         printf("Enter The First Number ");
         scanf("%f",&a);
         printf("Enter The Second Number ");
         scanf("%f",&b);
         printf("Enter The Third Number ");
         scanf("%f",&c);
         printf("Enter The Fourth Number ");
         scanf("%f",&d);
         if(a>b && a>c && a>d)
         {
         printf("First Number Is Maximum");
         }
         else if(b>a && b>c && b>d)
         {
         printf("Second Number Is Maximum");
         }
         else if(c>a && c>b && c>d)
         {
         printf("Third Number Is Maximum");
         }
         else if(d>a && d>b && d>c)
         {
         printf("Fourth Number Is Maximum");
         }
         else
         {
         printf("Please Enter Diffrent Value For Four Number ");
         }
         getch();
      }

The Output is :-

No comments:

Post a Comment