29 April 2012

The "Hello World" program written in C

            This is a simple program
  The program displays a message on the screen

void main()
    printf("Hello World");

  • #include<stdio.h> is a pre-processor instruction, which tells the compiler to make the library program available for use.
  • // indicates a comment. Anything written after // on the same line is ignored by the compiler. It is there only as  documentation for the programmer.
  • /* ... */ indicates a block comment. When the compiler sees /*, it ignores everything until it finds */.
  • 'C' is case sensitive - you must know when to use upper/lower case. In general, (but not always), 'C' specific words are lower case.

No comments:

Post a Comment