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 wud be the output?

main()
{
char *str[]={
"MANISH"
"KUMAR"
"CHOUDHARY"
};
printf("\nstring1=%s",str[0]);
printf("\nstring2=%s",str[1]);
printf("\nstring3=%s",str[2]);

a)string1=Manish
string2=Kumar
string3=Choudhary

b)string1=Manish
string2=Manish
string3=Manish

c)string1=Manish Kumar Choudhary
string2=(null)
string3=(null)

d)Compiler error





Answer Posted / rakesh soni

c)string1=Manish Kumar Choudhary
string2=(null)
string3=(null)

Bcoz, at the time of initialization, we are giving "mainsh"
"kumar" "choudhary", which is not comma seprated. so "Manish
kumar choudhary" string goes on to 0 position of the array
of char pointer. rest of 2 string have null.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do pointers need to be initialized?

1093


How can you tell whether two strings are the same?

1259


Which is best linux os?

1033


Give me the code of in-order recursive and non-recursive.

1378


What is meant by realloc()?

1164


Why do we need a structure?

1051


What are the usage of pointer in c?

1201


What are the main characteristics of c language describe the structure of ac program?

1218


What are the types of assignment statements?

1072


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2135


Explain modulus operator. What are the restrictions of a modulus operator?

1022


What is self-referential structure in c programming?

1226


Are there any problems with performing mathematical operations on different variable types?

1045


What is ## preprocessor operator in c?

1097


Explain what are the different data types in c?

1225