C Preprocessor - Programming

Q1:

Will the following program print the message infinite number of times?
#include<stdio.h>
#define INFINITELOOP while(1)

int main()
{
    INFINITELOOP
    printf("AptitudeCrack");
    return 0;
}

A Yes

B No

ANS:A - Yes

Yes, the program prints "AptitudeCrack" 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 "AptitudeCrack". Then it comes to while(1) and the loop runs infinitely.