<<< C, C++, and Java     Index     Memory as numbered boxes >>>

4. C, C++, and Java, cont.


  • 
    /* Hello World program in C */
    #include <stdio.h>
    int main()
    {
      printf( "Hello, World!\n" );
      return 0;
    }
    
    
  • 
    // Hello World program in C++
    #include <iostream>
    int main()
    {
      std::cout << "Hello, World!\n";
      return 0;
    }
    
    
  • 
    // Hello World program in Java
    public class HelloWorld
    {
      public static void main(String[] args)
      {
        System.out.println( "Hello, World\n" );
      }
    }
    
    

<<< C, C++, and Java     Index     Memory as numbered boxes >>>