wat is output of the following

int main()
{
const int j=2;
int i;
switch(i)
{
case 1:break;
case j:break;
default:break;
}
}

Answers were Sorted based on User's Feedback



wat is output of the following int main() { const int j=2; int i; switch(i) ..

Answer / kalyan chukka

Error Generated Because Case j is invalid declaration so
error generated

Is This Answer Correct ?    15 Yes 1 No

wat is output of the following int main() { const int j=2; int i; switch(i) ..

Answer / vikash gaurav

output will be nothing.... since i will have garbage value.
once going to switch case the value will not match with any
case so default value will be executed.

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More C Interview Questions

what is the difference between call by value and call by reference?

5 Answers   Genpact, Global Logic, Infosys,


What is a pointer?

1 Answers   ADP, IFFCO,


How can you return multiple values from a function?

0 Answers  


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

0 Answers  


What is printf () in c?

0 Answers  






wap in c to accept a number display the total count of digit

4 Answers  


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

1 Answers   TCS,


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

0 Answers  


What is the best way to comment out a section of code that contains comments?

0 Answers  


what will the following program do? void main() { int i; char a[]="String"; char *p="New Sring"; char *Temp; Temp=a; a=malloc(strlen(p) + 1); strcpy(a,p); //Line no:9// p = malloc(strlen(Temp) + 1); strcpy(p,Temp); printf("(%s, %s)",a,p); free(p); free(a); } //Line no 15// a) Swap contents of p & a and print:(New string, string) b) Generate compilation error in line number 8 c) Generate compilation error in line number 5 d) Generate compilation error in line number 7 e) Generate compilation error in line number 1

1 Answers   IBM,


What is nested structure with example?

0 Answers  


What is a stream water?

0 Answers  


Categories