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

Answers were Sorted based on User's Feedback



Switch (i) i=1; case 1 i++; case 2 ++i; break; case ..

Answer / 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

Switch (i) i=1; case 1 i++; case 2 ++i; break; case ..

Answer / jack

the value of i that was initialized before the switch
statement remains unchanged as the switch statement does
not have flower braces.

Is This Answer Correct ?    5 Yes 0 No

Switch (i) i=1; case 1 i++; case 2 ++i; break; case ..

Answer / ramesh

i as it is

Is This Answer Correct ?    5 Yes 0 No

Switch (i) i=1; case 1 i++; case 2 ++i; break; case ..

Answer / vinay

the value of i if we forget the mistake u done

it is i=2;

Is This Answer Correct ?    1 Yes 3 No

Switch (i) i=1; case 1 i++; case 2 ++i; break; case ..

Answer / rukmanee

output: i=1

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More C Interview Questions

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

3 Answers  


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); } wat is the o/p and how?

12 Answers   Tech Mahindra,


what value is returned to operating system after program execution?

0 Answers  


What are linker error?

0 Answers  






What is an example of structure?

0 Answers  


difference between the array and linked list general difference related to memory

2 Answers  


how to find a 5th bit is set in c program

4 Answers   IBM,


Why ordinary variable store only one value  

0 Answers  


What is the difference between typeof(foo) and myFoo.GetType()?

2 Answers   Synergy,


plssssss help !!....using array.. turbo c.. create a program that will accept number of words to be consored. .a word must not exceed 10 characters long .the text to be entered will be no longer than 200 characters .there will be no 10 words example: enter number of words to be censor: 5 enter words to censor: windows office microsoft bill gates enter text to censor: bill gates founded microsoft and makes office and windows sample output: <consored> <censored> founded <censored> and makes <censored> and <censored>

1 Answers  


simple program of graphics and their output display

0 Answers   Elysium,


Categories