फ़ंक्शंस के साथ C प्रोग्राम का आउटपुट क्या है?
What is the output of C program with functions?
int main() {
int a = 0;
printf("AJAY ");
return 1;
printf("VIJAY");
return 1;
}
A
AJAY VIJAY
B
AJAY
C
VIJAY
D
Compiler error
Explanation
Let's analyze the given C program:
Code:
int main() {
int a = 0;
printf("AJAY ");
return 1;
printf("VIJAY");
return 1;
}
Explanation:
printf("AJAY ");: This prints the string "AJAY " to the console.return 1;: Thereturnstatement causes the function to exit, so the program ends here. After the firstreturn 1;, the program will terminate, and the secondprintf("VIJAY");will never be executed.- The second
return 1;is unreachable code because the function has already returned at the firstreturn 1;.
Conclusion:
- The program prints only "AJAY ", and the code after the first
returnis not executed, so "VIJAY" will not be printed.
Correct Answer:
(B) AJAY.
Correct Answer: B) AJAY