c++ cout numbers code example
Example 1: c++ output
#include <iostream>
int main(){
std::cout << "Hello World!" << std::endl;
}
Example 2: c++ input from terminal when program is called
#include <iostream>
#include <string>
int main( int argc, char* argv[] )
{
std::string my_arg;
std::cout << argv[0] << std::endl;
if( argc == 2 )
{
my_arg = argv[1];
std::cout << "Argument passed in is " << my_arg << std::endl;
}
return 0;
}
Example 3: c++ cout int
#include <iostream>
std::cout << "Hello, World!" << std::endl;