C Programming Preprocessor

Which of the following is correct syntax for defining Mathematical constant PI using preprocessor directive in C language?

Answer: # define PI 3.14
Explanation

#define PI 3.14

This is the correct syntax for defining a constant using the C preprocessor directive.

It replaces every instance of PI with 3.14 before compilation begins.

This question appeared in Past Papers (6 times)
ETEA 25 Years Past Papers Subject Wise (Solved) (2 times)
KPK Teacher Past Papers SST PST CT TT PET (2 times)
Secondary School Teacher SST Past Papers, Syllabus, Jobs (2 times)
This question appeared in Subjects (1 times)

Install this app on your device for quick access right from your home screen.