How to write a program using float data type with constant value of variable in programing C language?
What is Float data type in programing language?
Float data type
The float is a short form of a floating point value in programing
language.
The value of float is a decimal term in the digits of mathematics such
as decimal number is a “4.4”. Similarly the float is a data type in the
programing language which holds the decimal value in a digit or number form.
The float value number has take up to maximum 6 digits after decimal
number. For example 5.000000 is a six digit after decimal number.
So you can use the float data type in the programing “C” language to perform the function of adding, subtracting, multiplying and divide also. All are in the function you have to use float data type of variable if you want to perform these functions with the decimal number.
Let us take an example of constant value of variable program with float data type in programing “C” language
Here is the image above to perform the constant value of variable of a
float data type with the value of 2.6 and 3.6 are the decimal numbers. In the
program the value of variable “a” is 2.6 and “b” is a 3.6 in the constant form
declared above the main body of the line below the “void main ()” which is for
a bulk value.
In the whole program the variable “c” is a zero value which is not a
null value of a “c” variable this means the variable have space to stores the
result of adding two variable of “a” and “b” before variable “c”. You can also
understand the “printf” statement is uses to print the value of adding function
that is why it is called “printf” {print function} in the program language in C
or C++.
No comments:
Post a Comment