How can i convert this pr0gram in conditi0nal operat0rs...?
I don't kn0w h0w to use more than tw0 conditi0ns in c0nditi0nal 0perat0rs.
We've learned to use two conditional operators conditions s0 far, for example, (a>b)? a:b ; but don't kn0w how t0 apply it for 3 c0nditions ?

i've wrote this pr0gram and i want a same pr0gram f0r conditional operator

int main(void)
{
int a,b,c,d;
clrscr();
printf ("Enter first value");
scanf ("%d",&b);
printf ("Enter second value");
scanf ("%d",&a);
printf ("Enter third value");
scanf ("%d",&c);
if (a>b && a>c)
d=a;
else if(b>a && b>c)
d=b;
else 
d=c;
printf ("%d",d);
}
jephthah commented: WTF d00d? are y0u retarded? -1

Recommended Answers

All 2 Replies

>>but don't kn0w how t0 apply it for 3 c0nditions ?

Is the o key broken on your keyboard? if( a > b) ? a : if( b > c) ? b : c; You could in theory just keep going on an on like that, but it will just make the code nearly impossible to understand.

if he'd bother to pay attention in the first thread he made on this, he'd understand this already.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.