Preprocessors


  1. Which of the following is the correct output for the program given below?
    #include <stdio.h>
    #define SQR(k) (k * k)
    int main( )
    {
    int p, q = 5 ;
    p = SQR (q + 3) ;
    printf ("%d\n" , p) ;
    return 0 ;
    }









  1. View Hint View Answer Discuss in Forum

    Because, on preprocessing the expression becomes p = (5 + 3 * 5 + 3 )

    Correct Option: B

    Because, on preprocessing the expression becomes p = (5 + 3 * 5 + 3 )
    i.e. p = 5 + 15 + 3 = 23