Program to find largest of three numbers

0
36
#include<stdio.h>
#include<conio.h>
void main()
{
  int a,b,c;
  clrscr();
  printf("Enter three numbers\n");
  scanf("%d%d%d",&a,&b,&c);
  if((a>b)&&(b>c))  /* use of logical &&, which gives true only when both of its
                        operands are true */
     printf("%d is largest\n",a);
  else     /* when a is not largest */
     if((b>a)&&(b>c))  /* checks for b is larger than a and c 
                            using logical operator */
          printf("%d is largest\n",b);
  else  /* when both above conditions are false then c is largest */
       printf("%d is largest\n",);
getch();
}
   Output 1:
   Enter three numbers 
   4 6 9
   9 is largest
   Output 2:
   Enter three numbers
   8 5 8
   8 is largest
   Output 3:
   Enter three numbers
   6 6 6
   6 is largest
Program to find largest of three numbers Program to largest of three numbers in cc Program to largest of three numbers program to print largest of three numbers in c program to find largest of three numbers using conditional operator a program to find largest of three numbers Program to find largest of three numbers Program to find largest of three numbers in c c program to find largest of three numbersĀ 

LEAVE A REPLY

Please enter your comment!
Please enter your name here