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


Please Help Members By Posting Answers For Below Questions

any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

633


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

764


What is the need of structure in c?

566


What is function what are the types of function?

560


Array is an lvalue or not?

640






How can I read and write comma-delimited text?

621


Is it better to use malloc() or calloc()?

649


How many types of sorting are there in c?

614


How many types of functions are there in c?

585


Explain how are 16- and 32-bit numbers stored?

784


What is main return c?

519


Why array is used in c?

553


how many key words availabel in c a) 28 b) 31 c) 32

635


What does it mean when the linker says that _end is undefined?

635


How can I insert or delete a line (or record) in the middle of a file?

575