Switch (i)
i=1;
case 1
i++;
case 2
++i;
break;
case 3
--i;
Output of i after executing the program

Answer Posted / shruti

WHAT IS THE VALUE OF I BEFORE ENTERING THE SWITCH CASE???

if the values is something other than 1 , 2 , 3 there wont
be any effect, ASSUMING u have forgotton to give the curly
braces.


otherwise,
you will get an error, if the curly braces are not there
for the switch case.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between malloc() and calloc()?

610


Can you write the function prototype, definition and mention the other requirements.

652


Explain how can I remove the trailing spaces from a string?

621


What is dynamic dispatch in c++?

552


Explain how does flowchart help in writing a program?

621






Write a program to swap two numbers without using third variable in c?

611


What does c mean?

585


What is string in c language?

617


What is the difference between array and pointer?

560


Do variables need to be initialized?

616


When is a null pointer used?

633


What are multibyte characters?

639


Difference between pass by reference and pass by value?

651


What is the best way of making my program efficient?

561


What is calloc()?

623