Discussion :: Control Instructions - Point Out Errors (Q.No.3)
|Rama said: (Sep 9, 2011)|
|What is the use of int main () and return 0? Can't we write main () without any return?|
|Jay said: (Sep 25, 2011)|
|Warning shall be there: unreachable code(for printf statement)....(according to turbo C++ compiler).|
|Aman said: (Dec 1, 2014)|
If we used datatype along with fun name so it is necessary to return something value if you wish to write main with return you can use void infront of main.
|Pooja said: (Jul 31, 2016)|
|But here, there are two cases so don't anyone think I should be initialized with 2!?|
|Nijara said: (Aug 22, 2016)|
|Why is the printf ignored by the compiler?|
|Swapnil Bais said: (Feb 15, 2017)|
printf is ignored because the compiler after coming to the switch statement it directly jumps to the case.
|Swapnilbais said: (Feb 15, 2017)|
|The printf is ignored because the compiler after reaching to the switch statement it directly jumps on the cases which is called by the user.|
|Rashmi said: (Aug 21, 2020)|
|Switch statement does not print any statement outside case and default blocks.|
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.