Demonstrate integer variables - C++ Data Type

C++ examples for Data Type:int

Description

Demonstrate integer variables

Demo Code

#include <iostream>
using namespace std;
int main()//  w  w  w  .j ava  2 s.c o  m
{
   int var1;               //define var1
   int var2;               //define var2
   var1 = 20;              //assign value to var1
   var2 = var1 + 10;       //assign value to var2
   cout << "var1+10 is ";  //output text
   cout << var2 << endl;   //output value of var2
   return 0;
}

Result


Related Tutorials