C++ examples for Language Basics:Console
Prints the numbers 1 to 4 on the same line with each pair of adjacent numbers separated by one space.
#include <iostream> int main(int argc, const char *argv[]) { std::cout << "1 2 3 4" << std::endl; std::cout << "1 " << "2 " << "3 " << "4 " << std::endl; std::cout << "1 "; std::cout << "2 "; std::cout << "3 "; std::cout << "4 " << std::endl; return 0;//from ww w . j a v a2 s . co m }