what is the output of the program and explain why??
#include<stdio.h>
void main ( )
{
int k=4,j=0:
switch (k)
{
case 3;
j=300;
case 4:
j=400:
case 5:
j=500;
}
printf (ā%d\nā,j);
}
Answer Posted / tejal
k=4 bcoz of this control directly switch to case 4 ,now i
holds the value 400 there is no any break statement after
case 4 so now control goes to case 5 and assign value of i
as 500 .now control comes out of the loop and print the
valus of i i.e. 500.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain heap and queue.
Can we compile a program without main() function?
How can you determine the maximum value that a numeric variable can hold?
When should a far pointer be used?
what are the different storage classes in c?
All technical questions
What is string length in c?
can anyone suggest some site name..where i can get some good data structure puzzles???
How can I swap two values without using a temporary?
In which header file is the null macro defined?
please give me some tips for the placement in the TCS.
What is a structure in c language. how to initialise a structure in c?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What is pass by value in c?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above