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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / b subrahmanyam
What does the current output look like this ans is c)
string1=MANISH KUMAR CHOUDHARY
string2=null
string3=null
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / guruprasad
Compiler Error= Initializer Syntax Error in function main();
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vijay r15
ans is c
But 1printing mistake in s1 all characters should be in caps
Any dbt mail to raj.vijay55@gmail.com
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ankush
The answer seems like....
string1=MANISHKUMARCHAUDHARY
string2=(null)
string3=
And curser is blinking after the last line....
ankushtyagi2008@gmail.com
| Is This Answer Correct ? | 1 Yes | 0 No |
how to find greatet of 10 numbers without using array?
4.A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above
What is chain pointer in c?
What is storage class?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value.
f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
In C program, at end of the program we will give as "return 0" and "return 1", what they indicate? Is it mandatory to specify them?
write a function that accepts an integer/char array and an search item.If the search item is there in the array return position of array and value else return -1.without using other array,without sorting,not to use more than one loop?
What is .obj file in c?
what is printf
Explain argument and its types.