Basic c++ program to print Variables and constant
Code:
Sample Output:
Comment bellow for your Query and Feedback
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;
}
#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
0 comments:
Confused? Feel free to ask
Post a Comment