Write a program that illustrate Macros with Arguments, C/C++ Programming

Assignment Help:

Write a program that illustrate  Macros with Arguments?

Macros is able to also have arguments, just as functions can.

#define AREA(x)(3.14*x*x)

Then at any time the preprocessor finds the phrase AREA (x) it expands it into the statement 3.14 * x * x be careful not to leave a blank space between the macro template and its arguments while defining the macro. The whole macro expansion should also be enclosed within parentheses.

# define AREA(x)(3.14*x*x)
# include

main()
{
float x=2.5,result;
result=AREA(x);
printf("%f",result);
}


Related Discussions:- Write a program that illustrate Macros with Arguments

What does it mean to declare a function as a static, (c) A static member fu...

(c) A static member function can access static member data only, static member functions and functions and data outside the class. A static member function may be called, even whil

Luminous Jewels - The Polishing Game, First line starts with T, number of t...

First line starts with T, number of test cases. Each test case T contains a necklace (N).

Create a class string which stores a string value, Question 1 Write a prog...

Question 1 Write a program that accepts two numbers from the user and swaps the two numbers without using a temporary variable Question 2 Write a program that accepts a 3x

GPA Calculator, I am having trouble declaring a variable and returning a va...

I am having trouble declaring a variable and returning a value from my function.

Resection method, recsection method source code for searching position

recsection method source code for searching position

String, Write a program that takes 3 small letters as input and sort them a...

Write a program that takes 3 small letters as input and sort them according to their ASCII value.

Loop statement, write a c++ program to accept 3 numbers and find the larges...

write a c++ program to accept 3 numbers and find the largest of 3 numbers

C programming, a c program to find the volume of sphere

a c program to find the volume of sphere

How to use turbo c, Sir i want to know all the basic knowledge of turbo c.

Sir i want to know all the basic knowledge of turbo c.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd