ExamVeda
Login
Home
21
Which data type is used to store a sequence of characters in C?
Discuss
Answer & Solution
Answer: Option A
Solution:
The data type used to store a sequence of characters in C is Option A: char. In C, you can use an array of characters (often referred to as a "string") or simply a single character variable to store individual characters or sequences of characters.

So, the correct answer is:
Option A: char
In C, you can declare a character array (string) like this:
char myString[] = "Hello, World!";

In this example, 'myString' is an array of characters, and it can store a sequence of characters, including letters, digits, symbols, and spaces.
22
In C, which operator is used for pointer-to-pointer relationships?
Discuss
Answer & Solution
Answer: Option A
Solution:
In C, the operator used for pointer-to-pointer relationships is Option A: *. The asterisk () operator is used for both declaring and dereferencing pointer variables. When you have a pointer-to-pointer (a pointer that points to another pointer), you use multiple asterisks to access the value pointed to by the second pointer.

So, the correct answer is:
Option A: *
Here's an example of a pointer-to-pointer relationship in C:
int num = 42;
int *ptr1 = # // Pointer to an integer
int **ptr2 = &ptr1; // Pointer to a pointer to an integer

// Access the value using the pointer-to-pointer
int value = **ptr2; // value is now 42
In this example, ptr2 is a pointer-to-pointer, and **ptr2 is used to access the value stored in num.
23
What is the purpose of the 'sizeof' operator in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
24
What does the 'NULL' keyword represent in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
25
Which library function is used to allocate memory dynamically in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
What is the purpose of the 'scanf' function in C?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
27
Which operator is used to access the value stored at a pointer address in C?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
28
What is the purpose of the 'goto' statement in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
29
Which header file is used for mathematical functions in C?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
30
What is the significance of the 'volatile' keyword in C?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board