Introduction to C Language
C is a high-level language that was founded in 1972 at AT&T Bell Labs by Mr. Dennis
Ritchie. It is popular due to its large feature list and speed. Many operating systems,
embedded programs used for microprocessors and games are built using C language.
Even today, many consider C language to be their first language to learn coding
because of its simplicity.
When we write a C program, the program is compiled by a compiler to convert it into
machine language code, which is the code that computers can understand. Writing C
programs is easier than writing directly in machine-level language, which is usually ones
and zeros. Instead, we can write C programs, which are closer to English and then use
a compiler to convert it into machine-level language.
Core Block of a C Program
Every C program has a hash include in the angular bracket header files. All header files
contain predefined functions, which we can directly use. We can include one or more
header files. All C programs start with a fixed function name called 'main'. Every
function in C returns a value, and in this case, we are returning a value as int.
The starting curly braces and ending curly braces indicate the point from where our
main function starts and where it ends. All the lines between these parentheses are our
block of main function. Inside of our main code block, we can have declaration
statements, decision control statements, loops, call to other functions, special keywords,
and our written value.
Execution of a C Program
During the time of compilation, the compiler combines our code line by line, and when it
gets converted into machine code, that machine code is also executed line by line.
Hence, it is necessary to understand how exactly we can instruct the computer in a
stepwise manner so that we can achieve our desired output.
Format Specifiers and Basic Functions
We are going to talk about format specifiers and basic functions that are required in
order to take input from the user or to display output to the user. The commonly used
functions are printf and scanf, and we will be requiring these functions quite often.
Character Sets and Constants in C Language
The character set in C has all alphabets, digits, facial symbols, and additional ASCII
characters. Constants in C language are of two types - primary constants and
secondary constants. Primary constants in C are integer, real, and character.
Basic Data Types in C
The three basic data types in C are int, float, and char. Int is used to store whole
numbers, while float is used to store real values or values that contain decimal points.
Char is used to store characters.
C is a high-level language that was founded in 1972 at AT&T Bell Labs by Mr. Dennis
Ritchie. It is popular due to its large feature list and speed. Many operating systems,
embedded programs used for microprocessors and games are built using C language.
Even today, many consider C language to be their first language to learn coding
because of its simplicity.
When we write a C program, the program is compiled by a compiler to convert it into
machine language code, which is the code that computers can understand. Writing C
programs is easier than writing directly in machine-level language, which is usually ones
and zeros. Instead, we can write C programs, which are closer to English and then use
a compiler to convert it into machine-level language.
Core Block of a C Program
Every C program has a hash include in the angular bracket header files. All header files
contain predefined functions, which we can directly use. We can include one or more
header files. All C programs start with a fixed function name called 'main'. Every
function in C returns a value, and in this case, we are returning a value as int.
The starting curly braces and ending curly braces indicate the point from where our
main function starts and where it ends. All the lines between these parentheses are our
block of main function. Inside of our main code block, we can have declaration
statements, decision control statements, loops, call to other functions, special keywords,
and our written value.
Execution of a C Program
During the time of compilation, the compiler combines our code line by line, and when it
gets converted into machine code, that machine code is also executed line by line.
Hence, it is necessary to understand how exactly we can instruct the computer in a
stepwise manner so that we can achieve our desired output.
Format Specifiers and Basic Functions
We are going to talk about format specifiers and basic functions that are required in
order to take input from the user or to display output to the user. The commonly used
functions are printf and scanf, and we will be requiring these functions quite often.
Character Sets and Constants in C Language
The character set in C has all alphabets, digits, facial symbols, and additional ASCII
characters. Constants in C language are of two types - primary constants and
secondary constants. Primary constants in C are integer, real, and character.
Basic Data Types in C
The three basic data types in C are int, float, and char. Int is used to store whole
numbers, while float is used to store real values or values that contain decimal points.
Char is used to store characters.