How to write the program in “C” language for adding two variables in the constant form?
What do you mean by a constant program in language?
Constant program
- The constant program is about value of the variable which is declared in the program.
- When you declare the data type then we declare the variable after declaring the data type.
- So there is the main reason to check the program is in constant category.
This constant program is compiled by any c/c++ compiler software.
Algorithm of constant program adding two variables in “C” language
- Start program with including preprocessor directive “#include”.
- Apply the header file of standard input and output “<stdio.h>”.
- Also apply the console input and output header file “<conio.h>”.
- Place the void main for bulk value “void main()”.
- Place the “and” sign in the program “{“ for main body of program.
- Declare the data type after the data types declare the variable and their values in the same line.
- Declare equation of the sum of two variables “c=a+b;”.
- Place the output statement in the next line “printf(“statement”);”.
- Then place the get character function in the next line “getch();”.
- Then close or stop the program with “}”.
Good post of program it is simple and easy to understand
ReplyDelete