Translate

Sunday, April 26, 2020

C Program to find the Largest Number among three numbers

/* Print the Largest Number*/

#include<stdio.h>
#include<conio.h>
void main()
{
   int a, b, c;
 printf("enter value in a = ");
 scanf("%d",& a);
 printf("enter value in b = ");
 scanf("%d",& b);
 printf("enter value in c = ");
 scanf("%d",& c);

  if(a>b)
     {
         if(a>c)
              printf("\na is Largest %d", a);
           else
              printf("\nc is Largest %d", c);
     }
     else
     {
         if(b>c)
            printf("\nb is Largest %d",b);
           else
            printf("\nc is Largest %d",c);
     }
    getch();

}
Output:




No comments:

Post a Comment

C program to make a calculator using the switch statement.

/*perform arithmetic calculation on integers in C language*/ #include<stdio.h> #include<conio.h> void main() {     char op;     ...