print text with variable console c++ code example
Example 1: how to output to console c++
/*there are 2 ways of doing it.*/
#include <iostream> // including the main thing needed
int main(){
std::cout << "Text here.";
//you could put using namespace std; so you just have to do
cout << "Text Here.";
//this isnt reccomended though.
printf("hi");
//is also an option.
return 0;
}
Example 2: c++ cout int
#include <iostream>
std::cout << "Hello, World!" << std::endl;