ExamVeda
Login
Home
21
What is the purpose of the fgets function in C?
Discuss
Answer & Solution
Answer: Option B
Solution:
The purpose of the fgets function in C is to read a string from the console.

fgets reads a line of text from the specified input stream and stores it into the string pointed to by the provided pointer.

This function is often used to read input from the user via the console.

Therefore, fgets = read a string from the console.
22
What does the strtok function do in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
23
How do you declare a two-dimensional integer array in C with 3 rows and 4 columns?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
24
What is the result of the expression strlen("Hello") in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
Which function is used to find the first occurrence of a character in a string in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
How do you declare a string in C that can store up to 50 characters?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
27
What is the purpose of the strncpy function in C?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
Which function is used to convert a string to an integer in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
29
What does the fgets function in C do when it encounters a newline character?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
30
How can you check if two strings are equal in C?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board