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
What is %s and %d in c?
What is meant by type casting?
Why doesnt long int work?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
How do I get a null pointer in my programs?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is the scope of global variable in c?
When is the “void” keyword used in a function?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
There seem to be a few missing operators ..
What is the auto keyword good for?
State two uses of pointers in C?
What are the c keywords?
Why is structure padding done in c?