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 / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable and explain rules to declare variable in c?

1109


Write a C program to count the number of email on text

1930


Write a program with dynamically allocation of variable.

1150


What is array of structure in c programming?

1300


What is strcpy() function?

1176


the question is that what you have been doing all these periods (one year gap)

2099


Are c and c++ the same?

1069


What is d scanf?

1103


Explain the array representation of a binary tree in C.

1239


What are reserved words with a programming language?

1153


What are the 4 types of functions?

1070


How many types of functions are there in c?

1158


Explain the difference between call by value and call by reference in c language?

1124


What is a nested loop?

1145


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2304