Variables are data values that may change for example the age of the user when the question is asked. During program execution, the variables may change. A memory position is a variable, and the further discussion can be defined as follows:
Syntax for declaring a variable:
dataType variableName = value;
C++ program code to declare the variable and hold value init.
double average = 50.00;//declaring double variable average that holds a double value "50.00"
Program:
#include <iostream>//header file
using namespace std;
int main()//main method
{
double average = 50.00;//defining double variable average that initialize value init
cout<<average;//print average value
return 0;
}
Output:
Please find the attached file.
Learn more:
brainly.com/question/17446500