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);

}

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %s and %d in c?

1105


What is meant by type casting?

1103


Why doesnt long int work?

1099


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1138


How do I get a null pointer in my programs?

1164


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

1192


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

1055


What is the scope of global variable in c?

1034


When is the “void” keyword used in a function?

1577


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1765


There seem to be a few missing operators ..

1094


What is the auto keyword good for?

1229


State two uses of pointers in C?

1106


What are the c keywords?

1255


Why is structure padding done in c?

1189