-->

WAP to understand const identifier

//program to understand const identifier

#include <iostream> //header file

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
{
    const int a=90;         //declaration of variable with constant value
   // a=8;                // not allowed here; because const identifier
    cout << "value of a(constant)="<<a << endl;
    return 0;
}

No comments:

Post a Comment