what is the output of the programme? #define ABC 20 #define XYZ 10 #define XXX ABC - XYZ void main() { int a; a = XXX * 10; printf("%d ", a); }

  1. 20

  2. 10

  3. 100

  4. -80


Correct Option: D

AI Explanation

To determine the output of the given program, let's go through each line of code:

  1. #define ABC 20 - This line defines a macro ABC with the value 20.
  2. #define XYZ 10 - This line defines a macro XYZ with the value 10.
  3. #define XXX ABC - XYZ - This line defines a macro XXX which is equal to the value of ABC minus XYZ. Substituting the values, XXX becomes 20 - 10, which is 10.
  4. void main() - This line declares the main function.
  5. int a - This line declares an integer variable 'a'.
  6. a = XXX * 10 - This line assigns the value of XXX multiplied by 10 to the variable 'a'. Substituting the value of XXX, the expression becomes a = 10 * 10, which is 100.
  7. printf("%d ", a); - This line prints the value of 'a' using the printf function.

Therefore, the output of the program will be "100".

The correct answer is C) 100.

Find more quizzes: