Adds two variables and then prints the answer to the console. - C++ Language Basics

C++ examples for Language Basics:Variable

Description

Adds two variables and then prints the answer to the console.

Demo Code

#include <iostream>

using namespace std;

int main()/*from w w  w  . ja v  a2  s  . c om*/
{
  int start;
  int time;
  int total;
  start = 37;
  time = 22;
  total =  start + time;
  cout << total << endl;
  return 0;
}

Result


Related Tutorials