Author: admin
-
Relational Operators in C
Relational operators in C are defined to perform comparison of two values. The familiar angular brackets < and > are the relational operators in addition to a few more as listed in the table below. These relational operators are used in Boolean expressions. All the relational operators evaluate to either True or False. C doesn’t have a Boolean data…
-
Arithmetic Operators in C
Arithmetic operators in C are certain special symbols, predefined to perform arithmetic operations. We are familiar with the basic arithmetic operations − addition, subtraction, multiplication and division. C is a computational language, so these operators are essential in performing a computerised process. In addition to the above operations assigned to the four symbols +, −, *, and / respectively, C…
-
Operators
An operator is a symbol that tells the compiler to perform specific mathematical or logical functions. By definition, an operator performs a certain operation on operands. An operator needs one or more operands for the operation to be performed. Depending on how many operands are required to perform the operation, operands are called as unary, binary or ternary operators.…
-
Storage Classes in C
A storage class defines the scope (visibility) and lifetime of variables and/or functions within a C Program. They precede the type that they modify. Type of Storage Classes in C We have four different storage classes in a C program − The auto Storage Class The auto storage class is the default storage class for all local variables. The example above defines two…
-
Format Specifiers in C
Format specifiers in C are certain special symbols used in the formatted console IO functions such as printf() and scanf(), as well as formatted file IO functions such as fprintf() and fscanf(). Format specifiers are formed of a predefined sequence of one or more alphanumeric characters followed by the % symbol. For example, %d, %s, %f, %lf,…
-
Escape Sequence in C
An escape sequence in C is a literal made up of more than one character put inside single quotes. Normally, a character literal consists of only a single character inside single quotes. However, the escape sequence attaches a special meaning to the character that appears after a backslash character (\). The \ symbol causes the compiler to escape out of the string and provide meaning…
-
Literals
The term “literal” in computer programming terminology refers to a textual representation of a value to be assigned to a variable. In C, you can assign a value to a variable in two ways − The initialization of a variable in C is done as follows − On the other hand, an indirect initialization of…
-
Constants
A constant in C is a user-assigned name to a location in the memory, whose value cannot be modified once declared. This is in contrast to a variable in C, which is also a named memory location, however whose value may be changed during the course of the code. Instead of repeatedly using hard-coded values in a program, it is advised…
-
Booleans in C
Unlike the int, char or float types, the ANSI C standard doesn’t have a built-in or primary Boolean type. A Boolean or bool data generally refers to the one that can hold one of the two binary values: true or false (or yes/no, on/off, etc.). Even if the bool type is not available in C, you can implement the behaviour of Booleans…
-
Type Conversion in C
The C compiler attempts data type conversion, especially when dissimilar data types appear in an expression. There are certain times when the compiler does the conversion on its own (implicit type conversion) so that the data types are compatible with each other. On other occasions, the C compiler forcefully performs the conversion (explicit type conversion),…