Declaring and printing variables

sAksham-Ar published on
1 min, 98 words

Categories: C++

Today we will learn how to declare and print variables in C++. In C++, variables can basically be declared of four types namely int,char,double and is for integers,char for characters,float for decimals and double for decimals with higher precision and x declares a variable x of type int. x=10 assigns the value of 10 to x.Then we use cout to print the value of x.

using namespace std;
int main()
    int x;
    return 0;