Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

C Programming :: String

Home > C Programming > String > General Questions

11. What is the output of the following 'C' program ?

#include
int main()
{
char arr[] = "Its very beautiful";
char *ptr = "Hello world";
char *str = "Sieze the day";
ptr = &arr[0];
printf("%s\n", ptr);
ptr = &str[0];
printf("%s\n", ptr);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

12. What is the output of the following 'C' program ?

#include
int main()
{
char arr[] = "Its very beautiful";
char *ptr = "Hello world";
char *str = "Sieze the day";
ptr = &arr[0];
printf("%s\n", ptr);
ptr = &str[0];
printf("%s\n", ptr);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

14. What is the output of the program?

#include
#include
void main ()
{
char str[][5] = {{'h','e','l','l'}, {'w','e','l','l'}};
printf("\n %s ", strncpy (*str, *(str + 1), 0));
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Commvault 

15. What is the output of the program?

#include
#include

void main () {
char str[][5] = {{'h','e','l','l'}, {'w','e','l','l'}};
char str1[15] = "All is ";
printf ("%s ", strcat(strchr(str1, 'l'), *(str+1)));
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Commvault 

16. Predict the output or error(s) for the following:

void main()
{
char string[]="Hello World";
display (string);
}
void display (char *string)
{
printf("%s",string);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Wipro 

17. In a compiler there is 36 bit for a word and to store a character 8 bits are needed. IN this to store a character two words are appended .Then for storing a K characters string, How many words are needed.

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

Tags:

Wipro 

18. What will be output of the following "c" code?

#include
void main()
{
char s[]="main";
int i;
for(i=0; s[i]; i++)
printf("%c %c %c %c", s[i], *(s+i), *(i+s),i[s]);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

19. Predict the output or error(s) for the following:

main(){
char string[]="HelloWorld";
display (string);
}
void display (char *string){
printf("%s",string);
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Compiler Error: Type mismatch in re declaration of function display

Workspace

Tags:

Wipro 

20. What will be the result of the following program?

#include
int main(){
char p[]="String";
int x;
if(p=="String"){
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
return 0;
}

View Answer | Discuss in Forum | Workspace | Asked In |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS