Thursday

Write a C program that reads three numbers and displays the largest among them.

#include<stdio.h>
#include<conio.h>
void main()
  {
    int a,b,c;
    clrscr();
    printf("\nEnter any three numbers: ");
    scanf("%d%d%d",&a,&b,&c);
    if(a>b && a>c)
     printf("%d is Greater",a);
    else if(b>a && b>c)
     printf("%d is Greater",b);
    else
     printf("%d is Greater",c);
    getch();
  }

No comments:

Post a Comment

Rahul-Notes