Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

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 output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / sathish

400

Is This Answer Correct ?    4 Yes 5 No

what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / gollapally

400
500

Is This Answer Correct ?    2 Yes 7 No

what is the output of the program and explain why?? #include<stdio.h> void main ( ) { ..

Answer / ramprabha

0

Is This Answer Correct ?    3 Yes 9 No

Post New Answer

More C Interview Questions

What is the difference between a structure and a union?

2 Answers  


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

0 Answers  


write a method for an array in which it can display the largest n next largest value.

1 Answers   Value Labs,


Explain what is wrong with this program statement?

0 Answers  


What does a function declared as pascal do differently?

0 Answers  


how to get the starting address of file stored in harddisk through 'C'program.

2 Answers   Siemens,


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

4 Answers   TCS,


write a proram to reverse the string using switch case?

0 Answers   Syntel,


Can main () be called recursively?

0 Answers  


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


What are the data types present in c?

0 Answers  


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.

0 Answers  


Categories