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

What does void main () mean?

729


What is an example of structure?

586


What is the default value of local and global variables in c?

557


What is the difference between struct and typedef struct in c?

652


How do you print an address?

740






Explain what’s a signal? Explain what do I use signals for?

606


how to write optimum code to divide a 50 digit number with a 25 digit number??

2747


What are the loops in c?

589


Why is this loop always executing once?

615


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

707


What do you mean by scope of a variable in c?

543


write a c program in such a way that if we enter the today date the output should be next day's date.

1677


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1793


difference between native and cross compilers

1669


`write a program to display the recomended action depends on a color of trafic light using nested if statments

1629