Fundamental
Hello, World!
#include <iostream> // import header file(s)
using namespace std; // invoke and specify the namespace
int main() { // define main function
cout << "Hello, world!"; // print Hello, world!
return 0; // return 0,end main function
}g++ -o hello hello.cppimport some.java.packages; // import declaration(s)
public HelloWorld {
// the main method returns void and gets the argument
// args(String) for receiving CLI args
public static void main(String[] args) {
System.out.println("Hello. World");
// void return
}
}Returning and Printing
Last updated