Boiler Plate Code
Note: This is the base code, you have to write everytime while writing C program.
Now we will understand the example from the previous chapter.
Understanding the pervious example
Description
- Line1: stdio.h is a header file in C which provides functionality for input and output and many other functions.
- Line2: int main() this is the starting point for the execution of your program. Any code inside its curly brackets will be executed.
- Line3: printf("Hello World!") is printing "Hello World!" on screen.
- Line4: return 0 means we are returning from main function there. This is the last line of the main function which is executed. Everything written after it is not executed.
- You need to put a semicolon (;) after every line of code.
- C compiler ignores white spaces. You can write all code in one line but this is not advisable.
- C is case sensitive language. E.g. Sam is not same as sam.
- If you have any confusion, you can read this tutorial again and do not worry if you do not understand the code now, just ignore and move ahead. You will understand it in the coming C.
Practice Exercises
Complete these exercises to reinforce your learning and earn XP
Sign in to track your progress and earn XP!
Exercise 1 of 2Easy
Which of the following is a best practice in programming?
10 XP~2 min
Exercise 2 of 2Easy
Code that is easy to read and understand is called ___ code.
10 XP~2 min