Switch Case in C Programming

“switch case ” is a case control structure.  It contains case and default values. “switch” statement takes a value as a expression for equality testing against a list of values/case. Switch case statement is used in programming to select one amont multiple options. syntax for a switch statement:-

Rules of switch statement − In a “switch” statement we can … Read more

Assignment Operators in C Programming

In a C language there are following assignment operators  − Operator Description Example = assignment operator (it assigns values of right side operands to left side operand ) a=5 += Add assignment operator a+=5 -= Subtract assignment operator a-=5 *= Multiply  assignment operator a*=5 /= Divide assignment operator a/=5 %= Modulus assignment operator a%=5 <<= … Read more

Bitwise Operators in C Programming

In a C programming language Bitwise operator works on bits and perform bit-by-bit operation. There are following bitwise operators in C:- Operator Description Example & Binary AND Operator   a & b | Binary OR Operator a| b ^ Binary XOR Operator  a^b ~ Binary One’s Complement Operator is unary ~a <<  Binary Left Shift … Read more

Logical Operators in C Programming

There are three logical operators in C language. Assume variable A and B holds 1 and 0 respectively then – Operator Description Example &&  AND operator (the condition becomes true if both the operands are non-zero) (A && B) is false. ||  OR Operator (the condition becomes true if any of the two operands is non-zero) (A … Read more

Relational Operators in C Programming

C Language has a following relational operators. For example: Assume variable A holds 100 and variable B holds 200 then − Operator Description Example == Equals to (A == B) is not true. != Not equal (A != B) is true. >  Greater than (A > B) is not true. <  Less than (A < B) is true. >= … Read more

Arithmetic Operators in C Programming

C language have a following arithmetic operators. Assume variable i holds 100 and variable j holds 200 then – Operator Description Example + Adds two operands. i + j = 300 − Subtracts second operand from the first. i − j = -100 * Multiplies two operands. i * j = 20000 / Divide. j / i = 2 … Read more

Operators in a C Programming

An operator is a symbol. It is used to tells the compiler to perform specific mathematical or logical functions. C language have a following types of built-in operators:− Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators

Basics of C Programming

Tokens In a C language, token is either a keyword, a symbol ,an identifier, a constant or a string literal. A C program consists of various tokens for example, the following C program consists of five tokens −

The individual tokens are −

Comments Comments are the text in C program and they … Read more

Format Specifiers in C Programming

In C programming there are number of data types and format specifiers is used to defines the type of data to be printed. Whether to print output or to take input in both case we required format specifiers. Format specifiers are also called as format string. list of format specifiers used in C language. Format … Read more

Variables in C Programming

Variables is a name given to memory location.              int x =10;                                                                                             here, x is a integer variable.                                                      Integer variable x is a name given to memory location and where we stored integer value10. Initialize multiple variable : we can also initialize multipleby comma separated list. int  a,b,c;          Here, we have initialized … Read more