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

Write a program to find factorial of a number using recursive function.

0 Answers   Global Logic, TCS,


How to write the code of the program to swap two numbers with in one statement?

2 Answers  


What is structure packing ?

2 Answers   HP,


What is huge pointer in c?

0 Answers  


Explain c preprocessor?

0 Answers  


write a c prog for removing duplicate character from an array and sorting remaining elements using a single array

1 Answers  


What is a lvalue

0 Answers   Global Logic,


What is void main ()?

0 Answers  


Explain how can I convert a string to a number?

0 Answers  


Can a local variable be volatile in c?

0 Answers  


Define function pointers?

1 Answers  


What are inbuilt functions in c?

0 Answers  


Categories