CONSTANTS , MANIPULATORS & PERCEDENCE

 

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    int a=10;
    cout<<"The value of a was "<<a<<endl;
    a=30;
    cout<<"The value of a is "<<a<<endl;

    //.........................CONSTANTS iN C++...............................//
    const int x=10;
    //.........................MANIPULATORS...................................//
    int m=1;
    int n=20;
    int o=1000;
    cout<<"The value of m without setw is "<<m<<endl;
    cout<<"The value of n without setw is "<<n<<endl;
    cout<<"The value of o without setw is "<<o<<endl;
    cout<<"\n";
    //.........................WITH SETW....................................//
    cout<<"The valu of m is "<<m<<setw(4)<<endl;
    cout<<"The valu of n is "<<n<<setw(4)<<endl;
    cout<<"The valu of o is "<<o<<setw(4)<<endl;
    cout<<"\n";
    //........................OPERATOR PRECEDENCE..........................//
    int j=3;
    int k=4;
    int l=(j*k)+800;
    cout<<"The value of l is "<<l<<endl;
    //..............................HIGHER PRECEDENCE....................//
    //PRECEDENCE- MULTIPLICATION, DIVISION, MODULO, ADDITION, SUBTRACTION//
    return 0;
}

Comments

Popular posts from this blog

C++ Tutorial Tutorial 1

OTen by Aqua Properties at Dubai Healthcare City

Emaar Grande Signature Residences