Skip to content

c++ program to print Variables and constant

Basic c++ program to print Variables and constant

Code:

/*Basic c++ program to print Variables and constant*/
#include<iostream.h>
const int CONST_VAL =5;
int main()
{
int ivalue;
float fvalue;
char cvalue;

ivalue=1234;
fvalue=123.45;
cvalue=’A’;

cout <<“integer value is=” <<ivalue << endl;
cout <<“float value is =” <<fvalue <<endl;
cout <<“char value is =” <<cvalue <<endl;
cout <<“the const is” << CONST_VAL;
return 0;

}

Sample Output:

Comment bellow for your Query and Feedback

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!