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

the answer will b 500 becoz...when first k = 4 is
executing...the value of j is 400 den thr is no break
statement...so it will continue..nd at the end of the
switch..j will contain or retain.. the value 500

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we change the value of #define in c?

580


What is a substring in c?

579


In which layer of the network datastructure format change is done

1424


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1406


When should a type cast be used?

571






What are header files in c programming?

651


What does the error message "DGROUP exceeds 64K" mean?

720


What is union in c?

626


How is a null pointer different from a dangling pointer?

550


How can you find the exact size of a data type in c?

591


code for find determinent of amatrix

1507


How is actual parameter different from the formal parameter?

583


Explain what is a pragma?

583


What does %d do?

708


What is null pointer in c?

585