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



what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

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

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

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

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

Answer / ramlal bishnoi

d) compiler error

Is This Answer Correct ?    6 Yes 1 No

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

Answer / guruprasad

Compiler Error= Initializer Syntax Error in function main();

Is This Answer Correct ?    1 Yes 0 No

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

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

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

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

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

Answer / shashi singh

compiler error

Is This Answer Correct ?    0 Yes 0 No

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

Answer / ravi

answer a

Is This Answer Correct ?    0 Yes 0 No

what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CH..

Answer / niranjan kumar niraj

d)Compile error

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Interview Questions

Write a program to print distinct words in an input along with their count in input in decreasing order of their count

0 Answers  


Hai why 'c' is the middle language

4 Answers  


What is the purpose of main() function?

0 Answers  


main() { unsigned int k = 987 , i = 0; char trans[10]; do { trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' ); } while(k /= 16); printf("%s\n", trans); }

4 Answers   Vector,


void main() { int a=1; printf("%d %d %d",a,++a,a++); } the output is supposed to be 1 2 2....but it is 3 3 1 this is due to calling conventions of C. if anyone can explain me how it happens?

7 Answers  






How do I convert a string to all upper or lower case?

0 Answers  


What is a #include preprocessor?

0 Answers  


How many bytes are occupied by near, far and huge pointers (dos)?

0 Answers  


Write a C Program to display the following menu: Menu 1. Display 2. Copy 3. Append 4. Exit Accept the choice (1-4) from the user, and perform the following tasks: Choice 1: Accept a file name from the user and display the file on screen Choice 2: Accept two file names, and copy first file to the second Choice 3: Accept two file names, and append second file to the first file Choice 4: Terminate the program

1 Answers   Accenture, Concor, DMU, Satyam, Syntel, Tora,


What library is sizeof in c?

0 Answers  


Describe the difference between = and == symbols in c programming?

0 Answers  


Explain what are multibyte characters?

0 Answers  


Categories