1 / 1

The Infamous “Hello World” Program

This text delves into the classic "Hello World" program written in C, showcasing its primary function of outputting "Hello, World!" to the console. It illustrates the use of the `putc()` function from the `stdio.h` library to print each character individually, and highlights critical C programming concepts such as function definition, the `main` function's structure, and the importance of semicolons in statement conclusion. This serves as a fundamental introduction for beginners trying to grasp basic programming syntax and structure.

triage
Download Presentation

The Infamous “Hello World” Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Infamous “Hello World” Program The Infamous “Hello World” Program /* Block Comments */ // End-of-Line (new in C99) #include <stdio.h>  /* putc(), stdout */ int main(void) { putc('H', stdout); putc('e', stdout); putc('l', stdout); putc('l', stdout); putc('o', stdout); putc(' ', stdout); putc('W', stdout); putc('o', stdout); putc('r', stdout); putc('l', stdout); putc('d', stdout); putc('!', stdout); putc('\n', stdout); return 0; } <> for Standard Include Directory “” for Current Directory first Preprocessor Directive Function call (or invocation) Statements end with semicolons. Argument List – comma separated Character Constant 4228160 (Borland TurboC/C++ v4.5) Function Definition ‘H’ = 72 (if ASCII is used) Type – “void” if nothing returned Name – EXACTLY one main() Parameter List – “void” of none taken int putc(int c, FILE *stream); Body = One Compound Statement

More Related