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
What does void main () mean?
What is an example of structure?
What is the default value of local and global variables in c?
What is the difference between struct and typedef struct in c?
How do you print an address?
Explain what’s a signal? Explain what do I use signals for?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What are the loops in c?
Why is this loop always executing once?
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
What do you mean by scope of a variable in c?
write a c program in such a way that if we enter the today date the output should be next day's date.
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
difference between native and cross compilers
`write a program to display the recomended action depends on a color of trafic light using nested if statments