#include <stdio.h>
#include <iostream>
using namespace std;
int main() // our main function
{
int value = 0; // variable that will hold the input value
// display a question
cout << "How many computers do you have? (answer with an integer)\n";
cin >> value; // input
cout << "You have " << value <<endl; // output
getchar(); // wait for a key to be pressed
return 0;
}
// get input from keyboard an place it in our new variable called value.
Download Visual C++ Source Code
I hope you found this c++ tutorial useful!
Don't forget to mention Apron Tutorials in your References!