Question
Consider the following C code: #include
#include int main() {   char str1[] = "Hello";   char str2[] = {'W', 'o', 'r', 'l', 'd', '\0', 'X'};   char str3[] = {'C', 'o', 'd', 'e'}; // No null terminator   printf("%zu %zu\n", strlen(str1), strlen(str2));   // What happens if strlen(str3) is called?   // printf("%zu\n", strlen(str3));   return 0; } What will be the output of the printf statement, and what would be the behavior if strlen(str3) were uncommented and executed?Solution
Correct Answer: B (strlen(str1) is 5. strlen(str2) counts up to the first \0, so 5. strlen(str3) would read past the allocated memory until it finds a \0, leading to undefined behavior (segmentation fault or garbage value).)
The Captain along with (A)/ his team has been (B)/ invited to the function (C)/ No Error (D)
A core network constitutes the network of rural roads in a State necessary to provide basic access for all habitations.
Thousands of scientific investigation have confirmed the association of smoking with the number of  diseases.Â
With the loss, India have put themselves in (1)/ a precarious position and need to win (2)/ at least 4 out of their next 6 Test matches to ensure (3)...
Identify the segment in the sentence that contains a grammatical error-
The taxi driver demanded fifty rupees to carry my luggages.
It farther stipulates that retail sales outlets be set up only in cities with a population of more than 10 lakh.
...In the question given below, a sentence is given, divided into parts. One of the parts may contain an error. Identify the part that contains the error,...
In each of the following questions, a sentence is given with four parts marked (a), (b), (c), and (d). One of these parts may contain an error. Identif...
I was offered a good position outside my hometown but I turned down the offer.
In each of the questions, a sentence has been divided into four parts, one of which may contain an error. Identify that fragment and mark it as your an...