Macros in c language
Welcome to c programming learning
Last post programs outputs
1. 3
2. 5
Now we are going to learn about macros in c programming
Last post programs outputs
1. 3
2. 5
Now we are going to learn about macros in c programming
MACROS
Macros are very useful. These are beginning of the program or above the main() function.
Let , #define is used to indicate macros
Macros are as follows...
1. Define something with their alias names then we use #define
Examples------ #define printf pf
Here we can use pf in the place of printf
2. Header files
#include<stdio.h>
In this we # that means pre processor. In this pre processor is execute first.
3. Conditional
In this we use condition loops that is if ,else
With beginning of #.
That is #if, #else
4. If there is defined something previously that can be remove defined that is by using #undefined
Examples------
#defined d 15
#undefined d 15
To make undefined of d value
Give the output below in comment section
Output:-
Give the output below in comment section
#include<studio.h>
#define n 15
void main()
{
printf("%d",n);
}
Output:-
Comments
Post a Comment