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

Do you know what are the properties of union in c?

577


What is meant by keywords in c?

614


How do I swap bytes?

626


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2116


What is the purpose of scanf() and printf() functions?

719






When should structures be passed by values or by references?

581


Between macros and functions,which is better to use and why?

1565


How we can insert comments in a c program?

628


Is c is a high level language?

618


Can a variable be both const and volatile?

669


What is the use of gets and puts?

599


Explain what are the standard predefined macros?

647


Difference between malloc() and calloc() function?

652


Can you please explain the difference between exit() and _exit() function?

585


The statement, int(*x[]) () what does in indicate?

640