Answers for "print to console c++"

C++
4

how to print a string to console in c++

// Just some basic format 

#include <iostream>
#include <string>
using namespace std;

int main()
{
 cout << "Print a String" << endl; 
}
Posted by: Guest on January-07-2020
2

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;
}
Posted by: Guest on May-24-2020
1

print to console c++

// Include the library for console in-/outputs
#include <iostream>

// Main function
int main()
{
  // Actual output line
  std::cout << "Hello World!" << std::endl;
}
Posted by: Guest on April-01-2021

Browse Popular Code Answers by Language