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

as there is no semicolon,uit will execute all the case
statements and j will be assigned as 500.
hence it will print 500..

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you return multiple values from a function?

623


What is the difference between struct and union in C?

562


What is c programming structure?

614


What is a class c rental property?

598


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

759






What is function prototype in c with example?

565


What is meant by gets in c?

598


Are negative numbers true in c?

587


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2213


How can I read data from data files with particular formats?

594


What is a nested loop?

641


Explain what will the preprocessor do for a program?

591


Explain how can you restore a redirected standard stream?

584


What is a struct c#?

596


What is structure in c definition?

564