outputs

how do u get a output to display on the screen in c++?
std::cout <<"Hello, World!"<<std::endl;
You're probably looking for cout << "Output"; where "Output" can be anything you want...
code snippet:
1
2
3
4
5
6
7
8
9
10
#include <iostream>

int main() {
using namespace std; //you can't use cout without this.. or you could use std::cout
int a=5;

cout << "a is" << a;

return 0;
}
Topic archived. No new replies allowed.