Answers for "how to output a variable in c++"

C++
1

how to output a variable in c++

// i/o example

#include <iostream>
using namespace std;

int main ()
{
  int i;
  cout << "Please enter an integer value: ";
  cin >> i;
  cout << "The value you entered is " << i;
  cout << " and its double is " << i*2 << ".\n";
  return 0;
}
Posted by: Guest on February-23-2021

Code answers related to "how to output a variable in c++"

Browse Popular Code Answers by Language