C Language Tutorial
C is a general-purpose, procedural computer programming language. Designed and developed by Dennis Ritchie at Bell Labs in 1972 for porting and developing the UNIX operating system.
C is a widely used computer language, as popular as Java, and is extensively used by modern software programmers.
The latest standard of C is C18, preceded by C17, C11, C99, and others.
Who Should Read This Tutorial?
This tutorial is designed for software programmers who need to learn C from scratch. It will give you enough understanding of the C language to enhance your professional knowledge.
Prerequisites for Reading This Tutorial:
Before starting this tutorial, you should have a basic understanding of computer programming terms. A basic understanding of any programming language will help you understand the C programming concepts and accelerate your learning.
Compiling/Executing C Programs
Example
#include <stdio.h>
int main()
{
/* My first C program */
printf("Hello, World! \n");
return 0;
}
Example Explanation:
- Every C program requires the main() function. Execution starts from the main() function.
- /* ... */ is used for comments.
- printf() is used for formatted output to the screen. The printf() function is declared in the "stdio.h" header file.
- stdio.h is a header file (standard input output header file), and #include is a preprocessor command to include the header file. If the compiler encounters the printf() function without the stdio.h header file, it will result in a compilation error.
- The return 0; statement is used to exit the program.