Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Strings
How will you print \n on the screen?
printf("\n");
echo "\\n";
printf('\n');
printf("\\n");
Correct Answer:
printf("\\n");
Explanation:
The statement
printf("\\n");
prints '\n' on the screen.
← Previous Question
Next Question→
More Questions from
Strings
The library function used to find the last occurrence of a character in a string is
Which of the following function sets first n characters of a string to a given character?
If the two strings are identical, then strcmp() function returns
Which of the following function is correct that finds the length of a string?
Which of the following function is more appropriate for reading in a multi-word string?
What will be the output of the program? #include
#include
int main() { static char s[] = "Hello!"; printf("%d\n", *(s+strlen(s))); return 0; }
What will be the output of the program? #include
#include
int main() { char str1[20] = "Hello", str2[20] = " World"; printf("%s\n", strcpy(str2, strcat(str1, str2))); return 0; }
What will be the output of the program? #include
int main() { char str1[] = "Hello"; char str2[] = "Hello"; if(str1 == str2) printf("Equal\n"); else printf("Unequal\n"); return 0; }
What will be the output of the program? #include
#include
int main() { char str[] = "India\0\CURIOUSTAB\0"; printf("%d\n", strlen(str)); return 0; }
What will be the output of the program? #include
#include
int main() { char str[] = "India\0\CURIOUSTAB\0"; printf("%s\n", str); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments