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
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 |
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 |
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 |
Explain indirection?
What will be the output of the following program #include<stdio.h> void main() { int i=20; i-=i+++++i++; printf("%d",i); }
how we can say java is platform independent, while we require JVM for that particular Operating System?
What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }
Is c# a good language?
How can I ensure that integer arithmetic doesnt overflow?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? }
14 Answers CDAC, GATE, NDS, TCS,
Is void a keyword in c?
Linked lists -- can you tell me how to check whether a linked list is circular?
Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.
Where are the auto variables stored?