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 / vijay r15

error
Becoz
j=0: j=400: // in these : should be replaced by ;
In case 3; // in this ; should be replaced by :

After correcting this the op is 500 becoz there is no break statement
Ans 500

Dbtfull guys mail to raj.vijay55@gmail.com

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the heap?

676


What is meant by operator precedence?

664


what type of questions arrive in interview over c programming?

1545


How can I read a binary data file properly?

627


What is a function in c?

565






What is the equivalent code of the following statement in WHILE LOOP format?

757


What is ## preprocessor operator in c?

607


What is the c value paradox and how is it explained?

567


Is c++ based on c?

642


Can you please compare array with pointer?

607


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

662


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

750


List the difference between a 'copy constructor' and a 'assignment operator' in C?

630


Why is sprintf unsafe?

611


simple program of graphics and their output display

1462