Advertisement

OUTput: Largest number/ Lowest number:


#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
  {    clrscr();
     int a,b,c,x;
     printf("If u want to get the largest num press-1,or getting the smaller num press-2:");
     scanf("%d",&x);
     if(x==1)
     {printf("Enter three values");
    scanf("%d %d %d",&a,&b,&c);
    if(a>b)
    {
    if(a>c)
    {printf("%d",a);}
    else{printf("%d",c);}}
    else
    {if(b>c)
     {
    if(b>a)
    {printf("%d",b);} }
    else{printf("%d",c);}}}
    getch();}

No comments:

Post a Comment

Please comment bellow. Share your knowledge