repl.it
@molinitomario/

Multiply By 2

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// including iostream because we want to use the contens of iostream, which gives us access to getting input and putting out message to the screen
#include <iostream>

int main() {
  // get the input from the user
  std::cout << "Enter an integer: ";
  int UserNumber{};
  std::cin >> UserNumber;

  std::cout << std::endl;

  // multiply the number entered by two

  int FinalResult = UserNumber * 2;

  std::cout << "Double " << UserNumber << " is:" << FinalResult << std::endl;

  std::cout << "Triple " << UserNumber << " is: " << UserNumber * 3 << std::endl;




}
Fetching token
?