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

the answer is 500 as break is not mentioned it goes to case
5 from case4 so value of j=500

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is identifiers in c with examples?

669


Write a simple code fragment that will check if a number is positive or negative.

700


What is a pointer and how it is initialized?

596


Define macros.

773


Why malloc is faster than calloc?

580






What is the value of a[3] if integer a[] = {5,4,3,2,1}?

660


What is the significance of scope resolution operator?

845


How do you define structure?

557


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1445


How do you print only part of a string?

602


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

718


What are categories used for in c?

556


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14943


What is a pointer on a pointer in c programming language?

611


Linked lists -- can you tell me how to check whether a linked list is circular?

633