#define in C language by R4R Team

In the C Programming Language, the #define directive allows the definition of macros within your source code. These macro definitions allow constant values to be declared for use throughout your code.

Syntax-
#define NAME value
or
#define NAME expression

-Where NAME is the keyword or thing that you can call to get the value or expression.

Note:
Do not put semicolon(;) after the #define line

program-

#include < stdio.h>
#define name "r4r.in"
#define age 10
int main()
{
printf("Value of name is %s\n",name);
printf("Value of age is %d",age);
return 0;
}


output-

Value of name is r4r.in
Value of age is 10




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!