Wednesday, 10 July 2013


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

Related Posts :



0 comments:

Confused? Feel free to ask

Post a Comment