hello friends....
TAKE THE FIRST STEP TO KNOWLEDGE FRIENDS BECAUSE KNOWLEDGE IS FREE.
>> /* GIVEN THREE VALUES, WRITE A C PROGRAM TO READ THREE VALUES FORMKEYBOARD AND PRINT OUT THE LARGEST OF THEM WITHOUT USING IF STATEMENT */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,max;
clrscr();
printf("enter any three values : \n");
scanf("%d%d%d",&a,&b,&c);
printf("a=%d\t b=%d\t c=%d\n",a,b,c);
max = (a>b ? a:b) > c ? (a>b ? a:b) : c;
printf("largest value is : %d\n",max);
getch();
}
/* OUTPUT */
====================
enter any three values :
10
20
30
a=10 b=20 c=30
largest value is : 30
* * * * * * * * * * * * * *http://www.dnpdeveloper.com
if you have like this blog so share and subscribe, comment for this blog.
if your any question, so comment pleass.
MY INSTAGRAM ID : dnp176
Comments
Post a Comment