C is a high-level structured oriented programming language, used in general-purpose programming, developed by Dennis Ritchie. In the beginning, C was used for developing system applications including:
To start learning C programming, you only have to install the C compiler in your system. Nowadays C and C++ both compilers come as a single integrated package that serves the purpose of C and C++ both program development.
The best way to achieve an editor and compiler in one is Codeblocks. If you have installed Codeblocks, we can start writing code.
In C programs, each word and punctuation is referred to as a “token”. C Tokens are the smallest building block or smallest unit of a C program.
Identifiers
Identifiers are names given to different entities such as constants, variables, structures, functions, etc.
int price;
double totalprice;
Keywords
The C keywords must be in your information because you can not use them as a variable name.
#include<stdio.h>
main() {
float a, b;
printf("Showing how keywords are used.");
return 0;
}
In the above program, “float” and “return” are keywords. The float is used to declare variables, and return is used to return an integer type value in this program.
Constants
Constants are like a variable, except that their value never changes during execution once defined.
const type constant_name;
For example:
#include<stdio.h>
main() {
const int SIDE = 10;
int area;
area = SIDE*SIDE;
printf("The area of the square with side: %d is: %d sq. units" , SIDE, area);
}
#technology #programming-languages #c #guides-and-tutorials #programming-c