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
What is identifier in c?
what will be maximum number of comparisons when number of elements are given?
what is event driven software and what is procedural driven software?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
What is #line?
Which is an example of a structural homology?
Differentiate between Macro and ordinary definition.
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Explain how to reverse singly link list.
Are the variables argc and argv are local to main?
Explain the use of fflush() function?
Why dont c comments nest?
How do you list a file’s date and time?
Wt are the Buses in C Language
Can you return null in c?