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);
}
Answers were Sorted based on User's Feedback
Answer / tejal
k=4 bcoz of this control directly switch to case 4 ,now i
holds the value 400 there is no any break statement after
case 4 so now control goes to case 5 and assign value of i
as 500 .now control comes out of the loop and print the
valus of i i.e. 500.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain modulus operator. What are the restrictions of a modulus operator?
what defference between c and c++ ?
write a C program to print the program itself ?!
What is an example of structure?
Differentiate between ordinary variable and pointer in c.
Write a program to use switch statement.
0 Answers Agilent, Integreon, ZS Associates,
Explain bit masking in c?
if we take a number as a char then can we manipulate(add, subtract) on this number
difference between semaphores and mutex?
Is it fine to write void main () or main () in c?
Write a C program where input is: "My name is xyz". output is: "xyz is name My".
Create a simple code fragment that will swap the values of two variables num1 and num2.