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);

}

Answers were Sorted based on User's Feedback



what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / 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

what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / sathish

400

Is This Answer Correct ?    4 Yes 5 No

what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / gollapally

400
500

Is This Answer Correct ?    2 Yes 7 No

what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / ramprabha

0

Is This Answer Correct ?    3 Yes 9 No

Post New Answer

More C Interview Questions

#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

0 Answers  


What does %c do in c?

0 Answers  


please can some one guide me, to the answer Write a C program to enter 15 numbers as an input from the keyboard and program will find and print odd numbers and their average. i have studied while and do while loop for loop if and else if switch

2 Answers  


Where in memory are my variables stored?

0 Answers  


What are the various types of control structures in programming?

0 Answers  






Explain two-dimensional array.

0 Answers  


What is the c language function prototype?

0 Answers  


Table of Sudoku n*n

0 Answers  


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

0 Answers  


write a program for even numbers?

19 Answers   TCS,


Who is invented by c?

24 Answers   Infosys, Mphasis,


DIFFERNCE BETWEEN THE C++ AND C LANGUAGE?

2 Answers   Wipro,


Categories