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

int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

648


What does a function declared as pascal do differently?

603


Explain how do you print an address?

652


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

652


What is LINKED LIST? How can you access the last element in a linked list?

629






Differentiate call by value and call by reference?

562


What was noalias and what ever happened to it?

590


What is the code in while loop that returns the output of given code?

1305


Explain null pointer.

615


In C language, a variable name cannot contain?

737


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1724


How can I rethow can I return a sequence of random numbers which dont repeat at all?

700


What is #include called?

565


What is the need of structure in c?

562


Explain goto?

709