- 3

Explain the code

Help me wizards

25th Mar 2020, 6:12 PM
Ajith
Ajith - avatar
14 Answers
+ 2
In this problem printf("hi-"); here are three characters and first it will be print hi- then these three characters works as input 3 and third case run so output is hi-c
26th Mar 2020, 4:38 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
switch(printf("hi-")); { case 1:printf("a");break; case 2:printf("b");break; case 3:printf("c");break; deafult:printf("default"); }
25th Mar 2020, 6:14 PM
Ajith
Ajith - avatar
+ 1
Output is hi-c.i know about switch how about in this case
25th Mar 2020, 6:17 PM
Ajith
Ajith - avatar
+ 1
AkR can u sort it out
25th Mar 2020, 6:19 PM
Ajith
Ajith - avatar
+ 1
S bro I posted this is the question. Output is hi-c. Okie. if u can help me
25th Mar 2020, 6:26 PM
Ajith
Ajith - avatar
+ 1
Okie thank you
25th Mar 2020, 6:28 PM
Ajith
Ajith - avatar
+ 1
Ajith printf("hi-") will print hi- and it returns 3 because there are 3 characters being printed. So switch(3) which is case 3 and hence the output hi-c.
25th Mar 2020, 6:41 PM
Avinesh
Avinesh - avatar
+ 1
Okie tq
26th Mar 2020, 7:56 AM
Ajith
Ajith - avatar
0
Tq so much
25th Mar 2020, 6:42 PM
Ajith
Ajith - avatar
0
In that switch case to experiment to so many cases and multiple option coding Swich case code is menu driwen programme
26th Mar 2020, 6:30 PM
mane narayan