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
- A C function print_matrix(int rows, int cols, int matrix[rows][cols]) is designed to print a matrix. #include void print_matrix(int rows, int cols, ...
- Consider the following C++ code: #include class Base { public: Base() { std::cout << "Base constructor" << std::endl; ...
- Binary Search is an efficient searching algorithm that follows the Divide and Conquer approach. What is its time complexity?
- A hash map (or dictionary) implemented with separate chaining is exhibiting very poor performance, even with a seemingly good hash function. Operations lik...
- What is the time complexity of the KMP algorithm for searching a pattern of length 'M' in a text of length 'N'?
- Which of these is a cloud-based IoT platform?
- What is the worst-case time complexity of the Bubble Sort algorithm?
- Which register stores the temporary results during computation?
- What is the default value of a boolean instance variable in Java?
- Which of the following statements about a primary key is correct?
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)