- C is a procedural programming language.
- It was initially developed by Dennis Ritchie in the year 1972.
- It was mainly developed as a system programming language to write an operating system.
- The main features of the C language include :
- low-level memory access
- simple set of keywords
- clean style
these features make C language suitable for system programmings like an operating system or compiler development.
- Many later languages have borrowed syntax/features directly or indirectly from the C language
- Like syntax of Java, PHP, JavaScript, and many other languages are mainly based on the C language.
- C++ is nearly a superset of C language (Few programs may compile in C, but not in C++).
For more information on C , click here
There are 6 basic sections responsible for the proper execution of a program. Sections are mentioned below:
- Documentation
- Preprocessor Section
- Definition
- Global Declaration
Main()Function- Sub Programs
main is a predefined keyword or function in C. It is the first function of every C program that is responsible for starting the execution and termination of the program.
It is a special function that always starts executing code from the main having int or void as return data type.
For more information of the following, click here
example program:
// Documentation
/**
* file: sum.c
* author: xyz
* description: program to find sum.
**/
// Link
#include <stdio.h>
// Definition
#define X 20
// Global Declaration
int sum(int y);
// Main() Function
int main(void)
{
int y = 55;
printf("Sum: %d", sum(y));
return 0;
}
// Subprogram
int sum(int y)
{
return y + X;
}These are glossary for some of the keywords, functions and terms used in this programs :
In C language, header files contain the set of predefined standard library functions. The “#include” preprocessing directive is used to include the header files with “.h” extension in the program. Here is the table that displays some of the header files used in the programs:
| Header files | Description | Example of contained functions |
|---|---|---|
| stdio.h | Input/Ouput functions | printf();, scanf(); |
| conio.h | Console Input/Output functions | getch();, clrscr(); |
| stdlib.h | General utility functions | malloc();, realloc(); |
| math.h | Mathematics fuctions | sqrt();, pow(); |
| string.h | String functions | strcpy();, strcmp(); |
In C programming, the preprocessor is a behind-the-scenes program that acts on your code before it reaches the actual compiler. It's like a prep cook getting everything ready for the main chef (the compiler)
In C programming, the compiler plays a critical role in converting your human-readable code into instructions the computer can understand.
Comments in C are essential elements that enhance code readability and maintainability. They are annotations or explanations added to the source code, but are ignored by the compiler during compilation.
Pointers are special variables that store memory addresses of other variables. Imagine your variables live in different houses on a street. A pointer holds the address (like a house number) of another variable on that street.
The list of Programs are divided into two parts .
For further informations on the programs click here
For further informations on the programs click here
🎉🎉 we welcome all contributors to contribute to this repository. For more information on terms of contributions, click here. ↑