
C is a computer programming language that was created primarily for use on the UNIX operating system by Brian Kernighan and Dennis Ritchie. It has since grown in popularity to become one of the most extensively used programming languages. C is the most popular programming language for building system software, however it may also be used to create applications.
Table of Contents
Key features in C language
There are following key features of C programming language:
- C is a Stable and Portable Programming Language.
- C is an excellent choice for system software.
- The C programming language is a structural programming language.
- The C programming language is referred to as the “Mother Language.”
- It is simple and has fast speed.
Advantages of C language
- C is a particularly efficient language due to its built-in features.
- Because of conditional and control statements, the process is quick.
- Module and Structured Programming.
- A C program built for one machine can be executed on another computer (running a different operating system) with little changes.
Disadvantages of C language
- In C language the error detection is poor.
- It doesn’t have any basic input-output commands.
Rules of writing C programs
- C is a case-sensitive programming language so you need to take care whatever you write.
- You have to write all of the keywords in lower case.
- You are aren’t allowed to be used keywords for anything else, such as naming variables or functions.
- When a program is run, the main () function is always called first.
Structure of c programs
1. Documentation Section
2. Link Section
3. Definition of constants
4. Global variable declaration
5. main()
{
i. declaration;
ii. executable statements;
}
Data types in C Programming
Data Types, such as int, float, and so on, are used to represent the kind of data being kept in a variable. Different forms of data are supported by C programming.
Categories of data types in C
The four categories of data types are as follows:
- Primary (or fundamental) data types
- User – defined data types
- Derived data type
- Empty data set
Variables in C
A variable is a descriptive term for a memory area in a computer. When you declare the variable, you are referring to the computer’s memory address.
Types of variables in C
- Local Variables
- Global Variables
Declaration and Initialization in C
A declaration starts with a data type, then one or more variable names, and finally a semicolon. A declaration informs the compiler about the variable’s name and the sorts of data it will store. It binds a set of variables to a certain data type.
Different Type of Declarations in C
int a, b;
short int s;
double d;
long double ld;
char ch;
Different Type of Initialization in C
Initialization is the process of giving variables their first values. The variables can be initialized by using assignment operators in C.
a = 0;
b = 2;
a = b = 2
a = b = c = min
Click here to get the list of C Programs