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
How can I get back to the interactive keyboard if stdin is redirected?
What does c mean in standard form?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
How can I automatically locate a programs configuration files in the same directory as the executable?
Does sprintf put null character?
When should I declare a function?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What is a null string in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
How can I write functions that take a variable number of arguments?
What are called c variables?
What are predefined functions in c?
What is difference between Structure and Unions?
What are terms in math?
What is bubble sort technique in c?