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

because there us no break statement after case

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why static variable is used in c?

546


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

634


What is bss in c?

593


Why we use int main and void main?

530


What are qualifiers in c?

564






What does 3 periods mean in texting?

587


What the advantages of using Unions?

665


How can I split up a string into whitespace-separated fields?

560


What is identifiers in c with examples?

666


How can you tell whether two strings are the same?

819


Are the expressions * ptr ++ and ++ * ptr same?

659


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

627


What is the use of header?

612


How many keywords are there in c?

581


What are the benefits of c language?

637