Tuesday, April 6, 2021

Let us discuss about a simple constant program in “C” language

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.

 

Let us discuss about a simple constant program in “C” language

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 “}”.

1 comment:

  1. Good post of program it is simple and easy to understand

    ReplyDelete