Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Programming 0455-3391-01. A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.

Similar presentations


Presentation on theme: "Computer Programming 0455-3391-01. A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return."— Presentation transcript:

1 Computer Programming 0455-3391-01

2 A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; }

3 A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; } This is a comment comments help explain the program to someone they are ignored by the computer

4 A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; } This is an instruction to the compiler to insert the contents of a file named “stdio.h” into the program supplies useful information for the compiler

5 A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return 0; } This tells the compiler we’re about to define a function, named main main is a special function; it is where your program starts running

6 A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n” ); return 0; } This is a C statement This statement calls a function named printf It causes the text to be printed on the screen


Download ppt "Computer Programming 0455-3391-01. A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return."

Similar presentations


Ads by Google