🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

फ़ंक्शंस के साथ 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:

  1. printf("AJAY ");: This prints the string "AJAY " to the console.
  2. return 1;: The return statement causes the function to exit, so the program ends here. After the first return 1;, the program will terminate, and the second printf("VIJAY"); will never be executed.
  3. The second return 1; is unreachable code because the function has already returned at the first return 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.

Latest Updates