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.")
Who formed the Indian Railways Association to introduce the railway in India?
The Konkan Railway was formed in the year:
The headquarters of Southern Coast Railway is located in _____________________
The first passenger train service in the south of India began in the year
Which railway station became the country's first all-women railway station under non- suburban category?
Who is the sole customer of DFCCIL?
Jamalpur has a training institute of Indian Railways for the training of
Deccan Odyssey is run by which state rail tourism?
Which is the Longest train in India?
A platform surrounded by rail lines from all the four sides is known as ________________ ?