Category Archives: Library

06. C – Variables

The naming of an address is known as a variable. Variable is the name of a memory location. Unlike constant, variables are changeable, we can change the value of a variable during the execution of a program. A programmer can choose a meaningful variable name. Example: average, height, age, total, etc. Variable Declaration: A typical variable… Read More »

07. C – Operators

An operator is a symbol that tells the compiler to perform specific mathematical or logical functions. C language is rich in built-in operators and provides the following types of operators – Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Misc Operators We will, in this chapter, look into the way each operator works.… Read More »

08. C – Operators Precedence

The precedence of operators determines which operator is executed first if there is more than one operator in an expression. Let us consider an example: In C, the precedence of * is higher than – and =. Hence, 17 * 6 is evaluated first. Then the expression involving – is evaluated as the precedence of – is higher than that of =. Here’s a table of operators precedence from higher… Read More »

09. C – Standard Library Functions

C Standard library functions or simply C Library functions are inbuilt functions in C programming. The prototype and data definitions of these functions are present in their respective header files. To use these functions we need to include the header file in our program. For example, If you want to use the printf() function, the header file <stdio.h> should… Read More »

10. C – Type Casting

Converting one datatype into another is known as type casting or, type-conversion. There are two types of type conversion: Implicit Type Conversion Also known as ‘automatic type conversion’. Done by the compiler on its own, without any external trigger from the user. Generally takes place when in an expression more than one data type is… Read More »

11. C – Input and Output

When we say Input, it means to feed some data into a program. An input can be given in the form of a file or from the command line. C programming provides a set of built-in functions to read the given input and feed it to the program as per requirement. When we say Output, it means… Read More »

12. C – Conditional Statements

What is a Conditional Statement in C? Conditional Statements in C programming are used to make decisions based on the conditions. Conditional statements execute sequentially when there is no condition around the statements. If you put some condition for a block of statements, the execution flow may change based on the result evaluated by the condition.… Read More »

13. C – switch Statement

The switch statement allows us to execute one code block among many alternatives. You can do the same thing with the if…else..if ladder. However, the syntax of the switch statement is much easier to read and write. Syntax of switch…case How does the switch statement work? The expression is evaluated once and compared with the values of each case label. If there is… Read More »

14. C – Loops

A loop statement allows us to execute a statement or group of statements multiple times. Given below is the general form of a loop statement in most of the programming languages In programming, a loop is used to repeat a block of code until the specified condition is met. C programming has three types of… Read More »

15. C – Nested Loops

C supports nesting of loops in C. Nesting of loops is the feature in C that allows the looping of statements inside another loop. Syntax of Nested loop Outer_loop   {       Inner_loop      {            // inner loop statements.      }          // outer loop statements.   }   Outer_loop and Inner_loop are the valid loops that can be a ‘for’ loop, ‘while’ loop or ‘do-while’ loop. Nested for loop The nested for… Read More »