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 / ramprabha

500

Is This Answer Correct ?    15 Yes 6 No

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

Answer / prasad

500

Is This Answer Correct ?    9 Yes 0 No

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

Answer / prashanth

the answer is 500 as break is not mentioned it goes to case
5 from case4 so value of j=500

Is This Answer Correct ?    7 Yes 1 No

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

Answer / avinash

because there us no break statement after case

Is This Answer Correct ?    6 Yes 0 No

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

Answer / gouse mohiddin

500

Is This Answer Correct ?    6 Yes 1 No

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

Answer / ashutosh tiwari

compiler error!
after case 3 there is semicolon & j=400 also ended with
semicolon

Is This Answer Correct ?    6 Yes 2 No

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

Answer / kalyan chukka

Ans is 500 i dont know y it printing 500 u mention k=3 or 4
or 5 any no it prints only 500

Is This Answer Correct ?    3 Yes 0 No

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

Answer / 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

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

Answer / vijay r15

error
Becoz
j=0: j=400: // in these : should be replaced by ;
In case 3; // in this ; should be replaced by :

After correcting this the op is 500 becoz there is no break statement
Ans 500

Dbtfull guys mail to raj.vijay55@gmail.com

Is This Answer Correct ?    2 Yes 0 No

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

Answer / 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

More C Interview Questions

what do the 'c' and 'v' in argc and argv stand for?

0 Answers   TISL,


#include<stdio.h> main() { int a=1; int b=0; b=++a + ++a; printf("%d %d",a,b); }

7 Answers   Infosys,


increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

0 Answers  


What is putchar() function?

0 Answers  


What are pointers? What are stacks and queues?

0 Answers   Hexaware,


#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

2 Answers   Facebook,


What is calloc in c?

0 Answers  


how write a addtion of two single dimensional array using of pointer in c language?

3 Answers   DRDO,


find the sum of two matrices and WAP for it.

0 Answers   Huawei,


i want to know the procedure of qualcomm for getting a job through offcampus

0 Answers   HCL,


#include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain &#1567;&#1567;&#1567;

4 Answers  


Categories