Beginning with C Programming
Writing the First Program in C
The following code is one of the simplest C programs that will help us the basic syntax structure of a C program.
Example:
#include <stdio.h>
int main() {
int a = 10;
printf("%d", a);
return 0;
}
Output
10
Let us analyze the structure of our program line by line.
Structure of the C program
After the above discussion, we can formally assess the structure of a C program. By structure, it is meant that any program can be written in this structure only. Writing a C program in any other structure will hence lead to a Compilation Error. The structure of a C program is as follows:
C Language Introduction
C is a procedural programming language initially developed by Dennis Ritchie in the year 1972 at Bell Laboratories of AT&T Labs. It was mainly developed as a system programming language to write the UNIX operating system.
The main features of the C language include:
- General Purpose and Portable
- Low-level Memory Access
- Fast Speed
- Clean Syntax
These features make the C language suitable for system programming like an operating system or compiler development.