Download presentation
Presentation is loading. Please wait.
Published byAnne Houston Modified over 8 years ago
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.