v Operators: - An operator is a symbol that tells or intimates to the compiler to perform specific calculations or manipulations on one or more operands. Operators are essential for performing computations and making decisions in programs. a + b is an operation a & b are operands + is an operator Based on number of operands involved: 1. Unary operators: - unary operators can be applied on only one operator. Example: - ++ , -- , - (unary minus) , sizeof , ~ (compliment) , ! (not). 2. Binary operators: - binary operators can be applied on two operands. Example: - + , -, * , / , etc. 3. Ternary operators: - Ternary operator can be applied on three operands. Example: - ?: (ternary conditional operator). C supports several operators, can be classified into following...
Arrays: - An array is a collection of elements of the same data type stored in contiguous memory locations. It is a derived data type and a homogenous data structure. It is a variable which can store multiple values of the same type under a single variable name, making it easier to manage and manipulate related data. The size of an array is fixed. To access the elements of an array, we use indexes or subscripts accordingly. array index or subscript is used to identify array elements address. Array index or subscript starts with 0 to n-1. Declaration of an array: - The declaration of an array means telling the compiler to create an array variable and reserving memory for a fixed number of elements of the same data type. Initialization of an array: - Initializing an array means assigning initial values to its elements. Types of arrays: - Arrays are classified based on the number of dimensions they have: ...
Variables: - A variable is a data name or an identifier which stores a value that can be changed during the program execution. Every variable might belong to any of the data types, like int, float, char, etc. The name of a variable can be composed of letters, digits, and the underscore character. It must begin with either a letter or an underscore. Variables are case-sensitive because uppercase and lowercase letters are distinct. C programming language also allows defining various other types of variables, like numeric array, character array, pointer, Structure, Union, Enumeration and etc. Example: - sum, height, _value Declaring a variable in C: - Variable declaration means telling the compiler about the name and type of a variable before using it in the program. Variable declaration is the process of reserving a memory location and defining the type of data that will be stored in that locatio...