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

#title.need help finising a pseudo code, I have to make a program that allo...

I have to make a program that allow the user input 10 numbers between 10 and 100 and if the number input is the same than the last number, should appear an error message. I have th

Oops, how to create the programs in c++ knowledge

how to create the programs in c++ knowledge

Flowchart, create a flowchart that display the assume that there are 3 sect...

create a flowchart that display the assume that there are 3 section each student ?

Program of binary tree, Program of Binary tree: Btree::Btree(int O) : ...

Program of Binary tree: Btree::Btree(int O) : itemsInContainer(0) {     finishInit(O); }   Btree::~Btree(void) {     if( root != 0 )         delete roo

Develop stocastic expert advisor, Project Description: Need to develop a...

Project Description: Need to develop an expert advisor base on sthocastic oscilator with my own setting.. Very basic touch line OB/OS only but on my setting n condition Skill

Explain about the variables in c language, Explain about the Variables in c...

Explain about the Variables in c language? The Variable is an identifier that is used to represent some specified kind of information within a designated portion of the program

Write a recursive function with cylinders, I need to make a fractal trees i...

I need to make a fractal trees in OpenGL C++ . The method used is to write a recursive function with cylinders of different sizes and angles to create the tree trunk and branches.

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