In switch statement control should move directly to case statement skipping any other statements. Here it should skip int b=20; and show an error as b undeclared. Why is it not so?
Type: Posts; User: vpshastry
In switch statement control should move directly to case statement skipping any other statements. Here it should skip int b=20; and show an error as b undeclared. Why is it not so?
int main(){
int a=1;
switch(a){
int b=20;
case 1: printf("b is %d\n",b);
break;
default: printf("default b is:\t%d", b);
...
main(){
int a=0010;
printf("a: %d\n", a);
return 0;
}
I got the output as "a: 8", can any one answer why is it so??
hey, can some one write the algorithm (in simple english)?
i mean i=i++ can't be divided as i=i and ++i
sry, i'm not fully satisfied with ur ans,,, i think both or not same in tat case...
its of course 12......
i expected 10 , bcz 'i'(RHS) gets incremented after assignin to 'i'( LHS)
i expected the output to be 10, 1st is assigni 10 to i, 2nd is incrementin 'i' after assignin it to i, 3rd is print,,,,, o thought a lot abt it.... atill i'm not gettin
i=10; i=i++; printf("%d",i);
for the above part of the prog i got output 11.... y is it? wat is the logic?
in this program the compiler is compiling the both else if and else statements simultaneously in same for loop..... i wanna know wat is problem with the program
/* program to convert infix to...
i've to simulate a quiz paper as my 3rd sem project usin c..
some questions'l be given , my program should prepare a question paper for required max marks by randomly selectin the questions...