Will the following program print the message an infinite number of times?
- Yes
- No
- 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