Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

chapter 1 jeven durand

#include <iostream>

using namespace std;

int main()
{
   std::cout << "Enter an integer: " << '\n';
   
   int num{ 0 }; // defines the integer as a variable
   std::cin >> num; // gets the integer value from user's keyboard
   
   int end{ num * 2 };
   std::cout << "Double of that is: " << end << '\n'; // multiplies the integer by 2
   
   std::cout << "Adding 2 to the product will give us: " << end + 2;
   return 0;
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.