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.
In a mixed school 25% of the scholars are infants under 7 and the number of girls above 7 is 4/5 of the number of boys above 7, and amounts to 120. Find...
A student scored 45 marks in a test and scored 25% less marks than passing marks. If passing marks is 30% of total marks, and Arijit scored 72% marks in...
The monthly earnings and expenses of a person are in the ratio of 8:3. The earnings increase by 40%, and the expenses decrease by...
Two students appeared in an exam and one secured 10 marks more than the other. If marks of student who got more marks is 52% of the sum of the marks of ...
A bulb-producing company found 17% of the total product defective. If the total number of nondetective products is 4565, then specify the number of tota...
The value of A’s car is depreciating by 36% every year whereas the value of his house is appreciating by 15% each year as compared to the previous yea...
Sonia goes to a clothing store with a certain amount of money. She can buy 90 shirts or 30 trousers with the money she has. However, she decides to save...
A spent 20% of his monthly income on study and 65% of the remaining on rent. If amount spent on rent is Rs. 1047.8, then find the amount spent on study
A man invested all his current month income in starting of a new business in which he spends 25% in advertisement 20% of remaining in furniture 10% of r...
In an examination of three papers of 200 marks each, a candidate got 120 and 100 marks in the first two papers. The percentage of marks he should get in...