WAP to print character constant.

//program to print character constant    //comment line
#include<iostream>              // header file to handle input and output
using namespace std;             //to handle all standard characters/functions,reserved words  used in program. we do not use in turboc++ compiler
int main()                        // main function as starting point of execution
    char value='s';
    cout<<"value="<<value<<endl//endl is a manipulator and causes a linefeed
    <<"second line"<<value;// cout is an object and is pre-defined. It is responsible for output stream. endl is to end the line.
                                   //<< is called insertion operator or put -to operator.
    return 0;                       // the string inside double quote is string constant. Here it is "hello world".

No comments:

Post a Comment