Friday, 26 June 2015



Aim – WAP To Compare Two Numbers And Print The Largest Number Without Using if

Code-



#include<stdio.h>

#include<conio.h>

void main ()

{

int a, b, c;

clrscr ();

printf ("Enter The Two Numbers Respectively: ");

scanf ("%d%d", &a, &b);

c=(a>b)?a:b;

printf ("The Largest Among The Two Number Is : %d", c);

getch ();

}

OUTPUT

Enter The Two Numbers Respectively : 26 10

The Largest Among Two Number Is : 26















No comments:

Post a Comment