c language tutorial

if statement in C Language

An if statement consists of a Boolean expression followed by one or more statements. Syntax The syntax of an ‘if’ statement in C programming language is − if(boolean_expression) { /* statement(s) will execute if the boolean expression is true */ } If the Boolean expression evaluates to true, then the block of code inside the […]

Control Statements in C Language

Decision making structures require that the programmer specifies one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false. Show below is […]

Operator precedence and associativity in C Language

Operators Precedence in C Operator precedence determines the grouping of terms in an expression and decides how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has a higher precedence than the addition operator. For example, x = 7 + 3 * 2; here, x is assigned 13, […]

Type conversion in C Language

Type casting is a way to convert a variable from one data type to another data type. For example, if you want to store a ‘long’ value into a simple integer then you can type cast ‘long’ to ‘int’. You can convert the values from one type to another explicitly using the cast operator as […]

Operators in C Language

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. […]

Storage classes in C Language

A storage class defines the scope (visibility) and life-time of variables and/or functions within a C Program. They precede the type that they modify. We have four different storage classes in a C program − auto register static extern The auto Storage Class The auto storage class is the default storage class for all local […]

Variables and memory locations in C Language

A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C has a specific type, which determines the size and layout of the variable’s memory; the range of values that can be stored within that memory; and the set of operations that can be applied […]

Fundamental data types in C Language

Data types in c refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted. The types in C can be classified as follows − Sr.No. Types & Description 1 Basic […]

Standard I/O in C Language

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, […]

Components of C language

You have seen the basic structure of a C program, so it will be easy to understand other basic building blocks of the C programming language. Tokens in C A C program consists of various tokens and a token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, […]

1 9 10 11 12 13