Question
A C function attempts to find a substring.
#include #include char* find_substring(char* haystack, char* needle) {   if (haystack == NULL || needle == NULL) {     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 != NULL) {     printf("Found: %s ", result);   } else {     printf("Not found or invalid input. ");   }   return 0; } What will be the output of this C program?Solution
Correct Answer: B (The if (haystack == NULL || needle == NULL) check correctly handles the NULL pattern, causing the function to return NULL and print "Not found or invalid input.")
Consider the following statements:
1. Chenab colony and Bari doab were the centres of revolutionary activities in Punjab.
2. Lal Falak and...
The Jallianwala Bagh massacre took place in which year?
In which year did the Jallianwala Bagh massacre take place.
Consider the following pairs with reference to the European powers and the first factories established by them:
Consider the following pairs:

Which of the above pairs...
Who was the Viceroy of India during the Quit India Movement.
Consider the following statements:
1. The teachings of Ramkrishna Paramhansa are characterized by the real-life issues of a common man.
With reference to the Civil Disobedience Movement, consider the following statements
1. Civil Disobedience Movement is a form of nonviolent re...
Consider the following statements with reference to advent of European power in India:
1. Farrukhsiyar’s Farmans exempted the British East In...
In which year did the Kohat riots occur in the North-West Frontier Province?