फ़ंक्शंस के साथ C प्रोग्राम का आउटपुट क्या है?
What is the output of C program with functions?
int main() {
int a = 0;
printf("AJAY ");
return 1;
printf("VIJAY");
return 1;
}
A)
B)
C)
D)
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;
: Thereturn
statement 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
return
is not executed, so "VIJAY" will not be printed.
Correct Answer:
(B) AJAY.