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

How variables are declared in c?

580


Explain #pragma statements.

612


code for find determinent of amatrix

1526


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

644


define string ?

676






What is the benefit of using const for declaring constants?

596


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

621


What is volatile variable in c with example?

594


explain what are pointers?

629


What does the && operator do in a program code?

707


When should I declare a function?

636


What is the difference between a function and a method in c?

571


What do you mean by recursion in c?

638


Where we use clrscr in c?

718


Subtract Two Number Without Using Subtraction Operator

364