Now you can Subscribe using RSS

Submit your Email

Here's A Quick Way To Solve A Problem with #define in c

A LIFE ABK
#define in c, define in c, macros in c, define c language, #define in c program

In this post, we will teach you what is #define in c and how it is work. #define in c is a very simple topic so we telling this topic.

To understand this program, you must have this knowledge:

what is #define in c?

a macro is an identifier defined in a #define preprocessor directive.

the #define directive defines an identifier and a character sequence a set of characters that will be substituted for the identifier each time it is encountered in the source file.

the identifier is referred to as a macro name and the replacement process as macro replacement.

as with symbolic constants, the macro identifier is replaced in the program with the replacement text before the program is compiled.

macros may be defined with or without arguments.

a macro without arguments is processed like a symbolic constant.

In a macro with arguments, the arguments are substituted in the replacement text, then the macro is expanded.

source code: program simple Interest with #define in c


Output Screen

    
Enter pri, rate, time : 5000 10 1

Intrest : 500.0000 
Your simple Intrest is : 5500.0000

Program Logic

We will include #define as a header file.

We just have to write #define. Then the name of the macro and the character-sequences.

We just have to take input from the user. whose macro we created. Have to pass the value in it. The macro will calculate and give the result.

Recommended Post








😊

Now next you are, write your code in the comment below.😊

A LIFE ABK / Author & Editor

0 Comments:

Post a Comment

Please do not enter any spam link in the comment box.

Coprights @ 2021-2022, Ancient Code Designed By AbK