Operator in C programming is a symbol use to perform some operation on variables, operands or with the constant. Some operator required 2 operand to perform operation or Some required single operation. Several operators are there those are, arithmetic operator, assignment, increment , decrement, logical, conditional, comma, size of , bitwise and others. In this article, I will be sharing different types of Operator in C with examples. Types of Operators in C Language An operator is a symbol that tells the compiler to perform certain mathematical or logical manipulations. C operators can be classified as 1. Arithmetic operators 2. Relational operators 3. Logical operators 4. Assignment operators 5. Increment or Decrement operators 6. Conditional operator 7. Bit wise operators 8. Special operators ARITHMETIC OPERATORS IN C All basic arithmetic operators are present in C. + add - subtract * multiplication / division % modulo division(remainder) An arithmetic operation involvin...
Animate traffic signal using C graphics #include <stdio.h> #include <conio.h> #include <graphics.h> #include <dos.h> #include <string.h> void main() { /* request auto detection */ int gdriver = DETECT, gmode, err; int i, j, k, x, y, color; char str[64]; /* initialize graphic mode */ initgraph(&gdriver, &gmode, "C:/TC/BGI"); for (i = 0; i < 3; i++) { /* clears graphic screen */ cleardevice(); /* draw the signal post */ setcolor(DARKGRAY); ...
Constant is a any value that cannot be changed during program execution. In any Language Constants are very important, so to know Constants in C Language with examples read complete article. In C, any number, single character, or character string is known as a constant. A constant is an entity that doesn’t change whereas a variable is an entity that may change. For example, the number 50 represents a constant integer value. The character string "Programming in C is fun.\n" is an example of a constant character string. C constants can be divided into two major categories: Primary constants − Integer, float, and character are called as Primary constants. Secondary constants − Array, structures, pointers, Enum, etc., called as secondary constants. List of Constants in C Language There are different types of constants in C programming. Decimal Constant 10, 20, 450 etc. Real or Floating-point Constant 10.3, 20.2, 450.6 etc. Octal Constant 021, 033, 046 e...