Hi guys is this possible to write a biggest number program( biggest among 3) in a single line

You can try this for three numbers a, b and c :

printf("\nLargest among the three is %d\n", ((((a>b)?a:b)>c)?((a>b)?a:b):c));

But there are other ways too....try to find out !!!

I am a fresher mitra pls tell me the other ways

This is the simplest way i thought it could be done...
Its a simple ternary operator (you can consider as "if else" blocks)

I will explain it with an easy example :
Suppose if a=2, b=1 and c=3.
Now our expression is ((a>b)?a:b)>c)?((a>b)?a:b):c)):
Consider (a>b)?a:b expression :
(a>b) is true so (a>b)?a:b will mean "a"... right !!!
now by replacing that part(highlighted in red below) in the expression by "a",
((a>b)?a:b)>c)?((a>b)?a:b):c))
we will get:

(a>c)?a:c
which means "c", as (a>c) is false.

So, c is the largest number and will be printed as the output.
Isn't it simple ???? ;)

ganesh read "let us c" book thoroughly.... amazing book on c programming

And a bit shorter version ;)

((a>b&&a>c)?a:((b>c)?b:c))
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.