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?
More IT Operating System Questions
- In threat modeling, what does STRIDE stand for (one of the categories)? Pick the item that is NOT part of STRIDE.
- In a multithreaded process, which resource is normally shared by all threads while each thread maintains its own program counter and register set?
- Which keyword is used for inheritance in C++?
- Which of the following statements about a dense index is correct?
- Consider the following JSON object: json { "user": { "id": "u123", "name": "Alice", "age": 30, "address": { "street": "123 ...
- In Java, which interface defines the basic operations for a queue, and which class is a common concrete implementation that supports these operations with ...
- Given processes with arrival times and burst times — P1(0,5), P2(1,3), P3(2,8), P4(3,6) — what is the average waiting time using Shortest Job First (SJF) p...
- Three processes P1 (burst time 10 ms), P2 (5 ms), and P3 (8 ms) all arrive at time 0 and are scheduled using Round Robin with a time quantum of 4 ms. What ...
- If a set 𝐴contains 4 elements, how many elements are there in its power set?
- What is the primary purpose of cookies on a website?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)