Interviews Questions, Algorithms, Aptitude, C Interview Program, C Theory Question, Aptitude Tricks, Test Series,

Wednesday, 7 July 2021

Interview Hack#40 Answer

 Will the following program print the message an infinite number of times? 

  1. Yes
  2. No
  3. Error

Correct 1) Yes

Explanation:

Yes, the program prints "JavaAbhigyan" and runs infinitely.

The macro INFINITELOOP while(1) replaces the text 'INFINITELOOP' by 'while(1)'

In the main function, while(1) satisfies the while condition and it prints "JavaAbhigyan". Then it comes to while(1) and the loop runs infinitely.

0 comments:

Post a Comment