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 |
What is the difference between a structure and a union?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
write a method for an array in which it can display the largest n next largest value.
Explain what is wrong with this program statement?
What does a function declared as pascal do differently?
how to get the starting address of file stored in harddisk through 'C'program.
consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is
write a proram to reverse the string using switch case?
Can main () be called recursively?
Write a program in c to input a 5 digit number and print it in words.
What are the data types present in c?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.