Introduction to C Programming
For Complete YouTube Video: Click Here
Table of Contents
What do you learn in this Class?
In this class, we will have an Introduction to C Programming. We also understand the terminology and the basic rules of writing a C Program.
Detailed Explanation
To understand any Programming language it is a good practice to start with a program.
Hence we will take a simple program and proceed with our discussion.
The image below is the program snippet that we are considering.
Every program that we write has to be given to the compiler. As a result, the program will get executed.
Whenever we give the program to the compiler it will check for the main() function. From there the execution starts.
main() is the convention to declare a function. main represents the name of the function followed by open and closed parentheses.
The start and end of the function are decided by the { } braces.
Open brace { decides the start of the function.
Closing brace } decides the end of the function.
The statements within those braces will get executed by the compiler.
C Program is a collection of statements.
Statements are the executable part of the program to do an action.
In the above program, the main() function has 5 statements.
In C, all the statements are executed sequentially or line by line.
Every statement has to end with a semicolon.
Summary
Points to Remember:
- A C program should have a main() function.
- The statements in the program should end with a semicolon.
- The statements in program will be executed sequentially or line by line.