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
Answer / kalyan chukka
Error Generated Because Case j is invalid declaration so
error generated
Is This Answer Correct ? | 15 Yes | 1 No |
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 |
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
What is a pointer?
How can you return multiple values from a function?
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
What is printf () in c?
wap in c to accept a number display the total count of digit
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.
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
What is the best way to comment out a section of code that contains comments?
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
What is nested structure with example?
What is a stream water?