फ़ंक्शंस के साथ 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:
- The
printf("AJAY ");prints "AJAY ". - The
return 1;statement causes the program to exit themainfunction immediately, returning 1. - Since the program exits at
return 1;, the lineprintf("VIJAY");is never executed.
Output:
The program prints "AJAY " and then exits. The statement to print "VIJAY" is ignored because of the return 1;.
So, the correct answer is:
(B) AJAY.
Correct Answer: B) AJAY