Question
A C function attempts to find a substring. #include #include char* find_substring(char* haystack, char* needle) { if (haystack == NULL || needle == NUL
- L { return NULL; } return strstr(haystack, needle); } int main() { char* text = "Hello World"; char* pattern = NULL; // Potential bug here char* result = find_substring(text, pattern); if (result != NUL
- L { printf("Found: %s ", result); } else { printf("Not found or invalid input. "); } return 0; } What will be the output of this C program?
More IT Operating System Questions
- Which statement is true regarding Frequency Modulation(FM)?
- Consider the following Java code snippet: import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.uti...
- The Statement object is created by using createStatement() method of Connection class.
- Which of the following best describes validation testing?
- What is the primary disadvantage of using an array as a data structure?
- What is a "final" class in Java?
- What is the decimal value represented by the 8-bit two's complement binary number 10110101?
- Binary Search is an efficient searching algorithm that follows the Divide and Conquer approach. What is its time complexity?
- What is the primary benefit of using comments in code?
- Consider the following C code snippet for calculating base raised to the power of exp: #include double power(double base, int exp) { ...
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)