Question
What is the purpose of the #define directive in
programming languages like C and C++?Solution
The #define directive in C and C++ is a preprocessor command used to define macros. Macros can be constants or code snippets that are substituted into the program wherever they are referenced. For example, #define PI 3.14 defines a constant named PI with the value 3.14 . Similarly, #define SQUARE(x) ((x) * (x)) defines a macro for computing the square of a number. This directive helps in making the code more readable, manageable, and easier to maintain by avoiding the repetition of constants and code fragments. It operates at the preprocessing stage before the actual compilation of the code begins.
Consider the following statements :
1.     A strait is a narrow passage of water between two landmasses.
2.     The shape of ...
The acronym UFFCCC stands forÂ
A city likely to record the lowest minimum annual temperature in July is
A tax payer pays Rs.2,10,000/- as income tax in a given year. If the rate of tax is nil on the first 2 lakh, 15% on the next 8 lakh and 25% on the rest,...
The Agasthyamalai Biosphere reserve is in:Â
Consider the following statements :
1.     All the megalithic (big stones) burials are underground.
2.     Sometimes, megalith...
The average of 10 numbers is 30. What will be the new average if one of the numbers is increased by 30 and five of the rest decreased by 4 each?
A cone is formed by rotating an equilateral triangle about its altitude. Fill in the blank.
Equilateral triangle : Cone = Square: ____
Who is the chairperson of 15th finance commissionÂ
How many times has the constitution been amended since its inception?