ExamVeda
Login
Home
11
Which data type is used to represent a single character in C?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
12
How can you initialize an array in C at the time of declaration?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
13
What is the output of printf("%d", sizeof("Hello")); in C?
Discuss
Answer & Solution
Answer: Option B
Solution:
The printf("%d", sizeof("Hello")) statement in C is used to determine the size (in bytes) of the string literal "Hello" including the null terminator. In C, string literals are automatically null-terminated.

The string "Hello" consists of 5 characters: 'H', 'e', 'l', 'l', 'o', and it also includes a null terminator ('\0') at the end to mark the end of the string.

So, the total size of the string literal "Hello" is 6 bytes (5 characters + 1 null terminator).

Therefore, the output of printf("%d", sizeof("Hello")) will be Option B: 6 because it's the size of the string in bytes, including the null terminator.
14
Which function is used to concatenate two strings in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
15
What is the correct way to declare and initialize a string in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
16
What is the term for a character array that is used to store text in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
17
How can you find the length of an array in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
18
What is the result of the expression sizeof(int) in C?
Discuss
Answer & Solution
Answer: Option A
Solution:
In C, sizeof(int) returns the number of bytes used to store an integer data type.

On most modern systems (especially 32-bit and 64-bit architectures), an int typically occupies 4 bytes.

Therefore, the expression sizeof(int) generally evaluates to 4.

However, it is important to note that the exact size can vary depending on the compiler and system architecture, but 4 bytes is the most commonly expected answer in standard environments.
19
Which function is used to copy one string to another in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
20
How do you access the last element of an array arr with n elements in C?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board