Thursday, October 30, 2025

Find Biggest of given Two Numbers and Find Biggest of given Three Numbers.

Find Biggest of given Two Numbers


#include<stdio.h>
main()
{
    int a,b;
    printf("\nEnter A and B values");
    scanf("%d%d",&a,&b);
    if(a>b)
       printf("\nA is Big");
    else
       printf("\nB is Big");
}

        




Find Biggest of given Three Numbers.

#include<stdio.h>
main()
{
    int a,b,c;
    printf("\nEnter A,B and C values");
    scanf("%d%d%d",&a,&b,&c);
    if(a>b && a>c)
       printf("\nA is Big");
    else
    if(b>c)
       printf("\nB is Big");
    else
       printf("\nC is Big");
}

         

    (or)


#include<stdio.h>
main()
{
     int a,b,c;
     printf("\nEnter A B &  C Values : ");
     scanf("%d%d%d",&a,&b,&c);
     if(a>b)
          if(a>c)
             printf("\nA is Big  %d",a);
          else
             printf("\nC is Big  %d",c);  
     else
     if(b>c)
        printf("\nB is Big  %d",b);   
     else
        printf("\nC is Big  %d",c);
}






No comments:

Post a Comment