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 bubble sort technique in c?

0 Answers  


what is unsigened char and what is the difference from char

2 Answers  


What are keywords in c with examples?

0 Answers  


What are the different types of pointers?

4 Answers   HCL, TCS,


1. main() { printf("%d",printf("HelloSoft")); } Output?

3 Answers   HCL,






What is the mean of function?

0 Answers  


what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.

6 Answers   HCL,


Explain how can you be sure that a program follows the ansi c standard?

0 Answers  


what r the cpu registers r ther?

1 Answers  


how can write all 1to 100 prime numbers using for loop,if and break ?

2 Answers   TCS,


Explain what are compound statements?

0 Answers  


where do we use volatile keyword?

1 Answers  


Categories