Strings

Q1: Which of the following statements are correct ?
1: A string is a collection of characters terminated by '\0'.
2: The format specifier %s is used to print a string.
3: The length of the string can be obtained by strlen().
4: The pointer CANNOT work on string.

A 1, 2

B 1, 2, 3

C 2, 4

D 3, 4

ANS:B - 1, 2, 3

Clearly, we know first three statements are correct, but fourth statement is wrong. because we can use pointer on strings. Eg. char *p = "AptitudeCrack".



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.