Variable Declaration in C++

Variables are basically Placeholders. It stores the values.

#include<iostream.h>
#include<conio.h>

void main()
{
    int a = 2;    // It will store 2 in a.
    int b = 3;    // It will store 3 in b.

    ans = a+b;    //It will add a and b;   

    cout << ans ;    //It will print the total.

    getch();
}

Post a Comment

0 Comments