Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Practice Problems
  • Python
  • C
  • C++
  • Java
  • Courses
  • Machine Learning
  • DevOps
  • Web Development
  • System Design
  • Aptitude
  • Projects
Open In App
Next Article:
Conditional Statements in Programming | Definition, Types, Best Practices
Next article icon

Types of Operators in Programming

Last Updated : 23 Apr, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Types of operators in programming are symbols or keywords that represent computations or actions performed on operands. Operands can be variables, constants, or values, and the combination of operators and operands form expressions. Operators play a crucial role in performing various tasks, such as arithmetic calculations, logical comparisons, bitwise operations, etc.

types-of-operators-in-programming
Types of Operators in Programming

Table of Content

  • Types of Operators in Programming
  • Arithmetic Operators in Programming
  • Comparison Operators in Programming
  • Logical Operators in Programming
  • Assignment Operators in Programming
  • Increment and Decrement Operators in Programming
  • Bitwise Operators in Programming

Types of Operators in Programming:

Here are some common types of operators:

  • Arithmetic Operators: Perform basic arithmetic operations on numeric values.
    • Addition (+)
    • Subtraction (-)
    • Multiplication (*)
    • Division (/)
    • Modulus (%)
  • Assignment Operators
    • Basic Assignment (=)
    • Add and Assign (+=)
    • Subtract and Assign (-=)
    • Multiply and Assign (*=)
    • Divide and Assign (/=)
    • Modulus and Assign (%=)
  • Unary Operators
    • Increment (++)
    • Decrement (--)
    • Unary Plus (+)
    • Unary Minus (-)
    • Logical NOT (!)
  • Comparison Operators
    • Equal to (==)
    • Not Equal to (!=)
    • Less Than (<)
    • Greater Than (>)
    • Less Than or Equal To (<=)
    • Greater Than or Equal To (>=)
  • Logical Operators
    • Logical AND (&&)
    • Logical OR (||)
    • Logical NOT (!)
  • Bitwise Operators
    • Bitwise AND (&)
    • Bitwise OR (|)
    • Bitwise XOR (^)
    • Bitwise NOT (~)
    • Left Shift (<<)
    • Right Shift (>>)
  • Conditional Operator
    • Ternary Operator (?:)

These operators provide the building blocks for creating complex expressions and performing diverse operations in programming languages. Understanding their usage is crucial for writing efficient and expressive code.

Arithmetic Operators in Programming:

Arithmetic operators in programming are fundamental components of programming languages, enabling the manipulation of numeric values for various computational tasks. Here's an elaboration on the key arithmetic operators:

OperatorDescriptionExamples
+ (Addition)Combines two numeric values, yielding their sum.result = 5 + 3; (result will be 8)
- (Subtraction)Subtracts the right operand from the left operand.difference = 10 - 4; (difference will be 6)
* (Multiplication)Multiplies two numeric values, producing their product.product = 3 * 7; (product will be 21)
/ (Division)Divides the left operand by the right operand, producing a quotient.quotient = 15 / 3; (quotient will be 5)
% (Modulo)Returns the remainder after the division of the left operand by the right operand.remainder = 10 % 3; (remainder will be 1)

These operators are foundational for mathematical calculations, financial computations, and various algorithmic implementations. They are commonly used in everyday programming scenarios, providing the tools necessary for handling numerical data and solving mathematical problems within a program. Understanding how to use arithmetic operators is essential for performing precise and efficient calculations in programming.

C++
#include <iostream> using namespace std;  int main() {      int a = 10, b = 5;     cout << a << " + " << b << " = " << a + b << endl;     cout << a << " - " << b << " = " << a - b << endl;     cout << a << " * " << b << " = " << a * b << endl;     cout << a << " / " << b << " = " << a / b << endl;     cout << a << " % " << b << " = " << a % b << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         int a = 10, b = 5;         System.out.println(a + " + " + b + " = " + (a + b));         System.out.println(a + " - " + b + " = " + (a - b));         System.out.println(a + " * " + b + " = " + (a * b));         System.out.println(a + " / " + b + " = " + (a / b));         System.out.println(a + " % " + b + " = " + (a % b));     } } 
Python3
a = 10 b = 5  print(f"{a} + {b} = {a + b}") print(f"{a} - {b} = {a - b}") print(f"{a} * {b} = {a * b}") print(f"{a} / {b} = {a / b}") print(f"{a} % {b} = {a % b}") 
JavaScript
// Main function function main() {     // Declare and initialize variables     let a = 10, b = 5;      // Output addition operation     console.log(a + " + " + b + " = " + (a + b));      // Output subtraction operation     console.log(a + " - " + b + " = " + (a - b));      // Output multiplication operation     console.log(a + " * " + b + " = " + (a * b));      // Output division operation     console.log(a + " / " + b + " = " + (a / b));      // Output modulus operation     console.log(a + " % " + b + " = " + (a % b)); }  // Call the main function to execute the program main(); 

Output
10 + 5 = 15 10 - 5 = 5 10 * 5 = 50 10 / 5 = 2 10 % 5 = 0 

Comparison Operators in Programming:

Comparison operators in programming are used to compare two values or expressions and return a Boolean result indicating the relationship between them. These operators play a crucial role in decision-making and conditional statements. Here are the common comparison operators:

OperatorDescriptionExamples
== (Equal to)Checks if the values on both sides are equal.5 == 5; (evaluates to true)
!= (Not equal to)Checks if the values on both sides are not equal.10 != 5; (evaluates to true)
< (Less than)Tests if the value on the left is less than the value on the right.3 < 7; (evaluates to true)
> (Greater than)Tests if the value on the left is greater than the value on the right.10 > 8; (evaluates to true)
<= (Less than or equal to)Checks if the value on the left is less than or equal to the value on the right.5 <= 5; (evaluates to true)
>= (Greater than or equal to)Checks if the value on the left is greater than or equal to the value on the right.8 >= 8; (evaluates to true)

These operators are extensively used in conditional statements, loops, and decision-making constructs to control the flow of a program based on the relationship between variables or values. Understanding comparison operators is crucial for creating logical and effective algorithms in programming.

C++
#include <iostream> using namespace std;  int main() {      int a = 5, b = 5, c = 10;     if (a == b)         cout << a << " is equal to " << b << endl;     if (a != c)         cout << a << " is not equal to " << c << endl;     if (a < c)         cout << a << " is less than " << c << endl;     if (a <= b)         cout << a << " is less than or equal to " << b << endl;     if (c > a)         cout << c << " is greater than " << a << endl;     if (a >= b)         cout << a << " is greater than or equal to " << b << endl;     return 0; } 
Java
/* package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         int a = 5, b = 5, c = 10;          if (a == b)             System.out.println(a + " is equal to " + b);         if (a != c)             System.out.println(a + " is not equal to " + c);         if (a < c)             System.out.println(a + " is less than " + c);         if (a <= b)             System.out.println(a + " is less than or equal to " + b);         if (c > a)             System.out.println(c + " is greater than " + a);         if (a >= b)             System.out.println(a + " is greater than or equal to " + b);     } } 
Python3
a = 5 b = 5 c = 10  if a == b:     print(f"{a} is equal to {b}") if a != c:     print(f"{a} is not equal to {c}") if a < c:     print(f"{a} is less than {c}") if a <= b:     print(f"{a} is less than or equal to {b}") if c > a:     print(f"{c} is greater than {a}") if a >= b:     print(f"{a} is greater than or equal to {b}") 
JavaScript
function main() {     let a = 5, b = 5, c = 10;      if (a === b)         console.log(a + " is equal to " + b);     if (a !== c)         console.log(a + " is not equal to " + c);     if (a < c)         console.log(a + " is less than " + c);     if (a <= b)         console.log(a + " is less than or equal to " + b);     if (c > a)         console.log(c + " is greater than " + a);     if (a >= b)         console.log(a + " is greater than or equal to " + b); }  main(); 

Output
5 is equal to 5 5 is not equal to 10 5 is less than 10 5 is less than or equal to 5 10 is greater than 5 5 is greater than or equal to 5 

Logical Operators in Programming:

Logical operators in programming are used to perform logical operations on Boolean values. These operators are crucial for combining or manipulating conditions and controlling the flow of a program based on logical expressions. Here are the common logical operators:

OperatorDescriptionExamples
&& (Logical AND)Returns true if both operands are true; otherwise, it returns false.true && false; (evaluates to false)
(||) Logical ORReturns true if at least one of the operands is true; otherwise, it returns false

true || false; (evaluates to true)

! (Logical NOT)Returns true if the operand is false and vice versa; it negates the Boolean value.!true; (evaluates to false)

These logical operators are frequently used in conditional statements (if, else if, else), loops, and decision-making constructs to create complex conditions based on multiple Boolean expressions. Understanding how to use logical operators is essential for designing effective and readable control flow in programming.

C++
#include <iostream> using namespace std;  int main() {      // Logical AND (&&)     int x = 5, y = 10;     if (x > 0 && y > 0) {         cout << "Both " << x << " and " << y              << " are greater than 0." << endl;     }      // Logical OR (||)     x = 15;     y = -5;     if (x > 0 || y > 0) {         cout << "At least one of " << x << " or " << y              << " is greater than 0." << endl;     }      // Logical NOT (!)     if (!(x == y)) {         cout << x << " is not equal to " << y << endl;     }     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         // Logical AND (&&)         int x = 5, y = 10;         if (x > 0 && y > 0) {             System.out.println("Both " + x + " and " + y                                + " are greater than 0.");         }          // Logical OR (||)         x = 15;         y = -5;         if (x > 0 || y > 0) {             System.out.println("At least one of " + x                                + " or " + y                                + " is greater than 0.");         }          // Logical NOT (!)         if (!(x == y)) {             System.out.println(x + " is not equal to " + y);         }     } } 
Python3
# Logical AND (and) x, y = 5, 10 if x > 0 and y > 0:     print(f"Both {x} and {y} are greater than 0.")  # Logical OR (or) x, y = 15, -5 if x > 0 or y > 0:     print(f"At least one of {x} or {y} is greater than 0.")  # Logical NOT (not) if not (x == y):     print(f"{x} is not equal to {y}") 
JavaScript
// Logical AND (&&) let x = 5, y = 10; if (x > 0 && y > 0) {     console.log(`Both ${x} and ${y} are greater than 0.`); }  // Logical OR (||) x = 15; y = -5; if (x > 0 || y > 0) {     console.log(`At least one of ${x} or ${y} is greater than 0.`); }  // Logical NOT (!) if (!(x === y)) {     console.log(`${x} is not equal to ${y}`); } 

Output
Both 5 and 10 are greater than 0. At least one of 15 or -5 is greater than 0. 15 is not equal to -5 

Assignment Operators in Programming:

Assignment operators in programming are used to assign values to variables. They are essential for storing and updating data within a program. Here are common assignment operators:

OperatorDescriptionExamples
= (Assignment)Assigns the value on the right to the variable on the left.x = 10; assigns the value 10 to the variable x.
+= (Addition Assignment)Adds the value on the right to the current value of the variable on the left and assigns the result to the variable.x += 5; is equivalent to x = x + 5;
-= (Subtraction Assignment)Subtracts the value on the right from the current value of the variable on the left and assigns the result to the variable.y -= 3; is equivalent to y = y - 3;
*= (Multiplication Assignment)Multiplies the current value of the variable on the left by the value on the right and assigns the result to the variable.z *= 2; is equivalent to z = z * 2;
/= (Division Assignment)Divides the current value of the variable on the left by the value on the right and assigns the result to the variable.a /= 4; is equivalent to a = a / 4;
%= (Modulo Assignment)Calculates the modulo of the current value of the variable on the left and the value on the right, then assigns the result to the variable.b %= 3; is equivalent to b = b % 3;

Assignment operators are fundamental for updating variable values, especially in loops and mathematical computations, contributing to the dynamic nature of programming. Understanding how to use assignment operators is essential for effective variable manipulation in a program.

C++
#include <iostream> using namespace std;  int main() {      // Assignment (=)     int x;     x = 10;     cout << "x after assignment: " << x << endl;      // Addition Assignment (+=)     x += 3;     cout << "x after x += 3: " << x << endl;      // Subtraction Assignment (-=)     x -= 2;     cout << "x after x -= 2: " << x << endl;      // Multiplication Assignment (*=)     x *= 4;     cout << "x after x *= 4: " << x << endl;      // Division Assignment (/=)     x /= 2;     cout << "x after x /= 2: " << x << endl;      // Modulo Assignment (%=)     x %= 3;     cout << "x after x %= 3: " << x << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         // Assignment (=)         int x;         x = 10;         System.out.println("x after assignment: " + x);          // Addition Assignment (+=)         x += 3;         System.out.println("x after x += 3: " + x);          // Subtraction Assignment (-=)         x -= 2;         System.out.println("x after x -= 2: " + x);          // Multiplication Assignment (*=)         x *= 4;         System.out.println("x after x *= 4: " + x);          // Division Assignment (/=)         x /= 2;         System.out.println("x after x /= 2: " + x);          // Modulo Assignment (%=)         x %= 3;         System.out.println("x after x %= 3: " + x);     } } 
Python3
# Assignment (=) x = 10 print("x after assignment:", x)  # Addition Assignment (+=) x += 3 print("x after x += 3:", x)  # Subtraction Assignment (-=) x -= 2 print("x after x -= 2:", x)  # Multiplication Assignment (*=) x *= 4 print("x after x *= 4:", x)  # Division Assignment (/=) x /= 2 print("x after x /= 2:", x)  # Modulo Assignment (%=) x %= 3 print("x after x %= 3:", x) 
JavaScript
// Assignment (=) let x; x = 10; console.log("x after assignment: " + x);  // Addition Assignment (+=) x += 3; console.log("x after x += 3: " + x);  // Subtraction Assignment (-=) x -= 2; console.log("x after x -= 2: " + x);  // Multiplication Assignment (*=) x *= 4; console.log("x after x *= 4: " + x);  // Division Assignment (/=) x /= 2; console.log("x after x /= 2: " + x);  // Modulo Assignment (%=) x %= 3; console.log("x after x %= 3: " + x); 

Output
x after assignment: 10 x after x += 3: 13 x after x -= 2: 11 x after x *= 4: 44 x after x /= 2: 22 x after x %= 3: 1 

Increment and Decrement Operators in Programming:

Increment and decrement operators in programming are used to increase or decrease the value of a variable by 1, respectively. They are shorthand notations for common operations and are particularly useful in loops. Here are the two types:

OperatorDescriptionExamples
++ (Increment)Increases the value of a variable by 1.x++; is equivalent to x = x + 1; or x += 1;
-- (Decrement)Decreases the value of a variable by 1.y--; is equivalent to y = y - 1; or y -= 1;

These operators are frequently employed in loops, especially for iterating through arrays or performing repetitive tasks. Their concise syntax enhances code readability and expressiveness.

C++
#include <iostream> using namespace std;  int main() {     // Increment Operator (++)     int a = 5;     cout << "Value of a: " << a << endl;     a++;     cout << "Value of a after (a++): " << a << endl;      // Decrement Operator (--)     int b = 8;     cout << "Value of b: " << b << endl;     b--;     cout << "Value of b after (b--): " << b << endl;      // Increment Operator in Expression     int x = 10;     int y = x++;     cout << "Value of x: " << x << endl;     cout << "Value of y (post-increment): " << y << endl;      // Decrement Operator in Expression     int m = 15;     int n = --m;     cout << "Value of m: " << m << endl;     cout << "Value of n (pre-decrement): " << n << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         // Increment Operator (++)         int a = 5;         System.out.println("Value of a: " + a);         a++;         System.out.println("Value of a after (a++): " + a);          // Decrement Operator (--)         int b = 8;         System.out.println("Value of b: " + b);         b--;         System.out.println("Value of b after (b--): " + b);          // Increment Operator in Expression         int x = 10;         int y = x++;         System.out.println("Value of x: " + x);         System.out.println("Value of y (post-increment): " + y);          // Decrement Operator in Expression         int m = 15;         int n = --m;         System.out.println("Value of m: " + m);         System.out.println("Value of n (pre-decrement): " + n);     } } 
Python3
# code in python # Increment Operator (++) a = 5 print("Value of a:", a) a += 1 print("Value of a after (a++):", a)  # Decrement Operator (--) b = 8 print("Value of b:", b) b -= 1 print("Value of b after (b--):", b)  # Increment Operator in Expression x = 10 y = x x += 1 print("Value of x:", x) print("Value of y (post-increment):", y)  # Decrement Operator in Expression m = 15 n = m m -= 1 print("Value of m:", m) print("Value of n (pre-decrement):", n)  #this code is contributed by Sundaram 
JavaScript
// Increment Operator (++) let a = 5; console.log("Value of a: " + a); a++; console.log("Value of a after (a++): " + a);  // Decrement Operator (--) let b = 8; console.log("Value of b: " + b); b--; console.log("Value of b after (b--): " + b);  // Increment Operator in Expression let x = 10; let y = x++; console.log("Value of x: " + x); console.log("Value of y (post-increment): " + y);  // Decrement Operator in Expression let m = 15; let n = --m; console.log("Value of m: " + m); console.log("Value of n (pre-decrement): " + n); 

Output
Value of a: 5 Value of a after (a++): 6 Value of b: 8 Value of b after (b--): 7 Value of x: 11 Value of y (post-increment): 10 Value of m: 14 Value of n (pre-decrement): 14

Bitwise Operators in Programming:

Bitwise operators in programming perform operations at the bit level, manipulating individual bits of binary representations of numbers. These operators are often used in low-level programming, such as embedded systems and device drivers. Here are the common bitwise operators:

OperatorDescriptionExamples
& (Bitwise AND)Performs a bitwise AND operation between corresponding bits of two operands.A & B sets each bit to 1 if both corresponding bits in A and B are 1.
| (Bitwise OR)Performs a bitwise OR operation between corresponding bits of two operands.A | B sets each bit to 1 if at least one corresponding bit in A or B is 1.
^ (Bitwise XOR)Performs a bitwise XOR (exclusive OR) operation between corresponding bits of two operands.A ^ B sets each bit to 1 if the corresponding bits in A and B are different.
~ (Bitwise NOT)Inverts the bits of a single operand, turning 0s to 1s and vice versa.~A inverts all bits of A.
<< (Left Shift)Shifts the bits of the left operand to the left by a specified number of positions.A << 2 shifts the bits of A two positions to the left.
>> (Right Shift)Shifts the bits of the left operand to the right by a specified number of positions.A >> 3 shifts the bits of A three positions to the right.

Bitwise operators are useful in scenarios where direct manipulation of binary representations or specific bit patterns is required, such as optimizing certain algorithms or working with hardware interfaces. Understanding bitwise operations is essential for low-level programming tasks.

C++
#include <iostream> using namespace std;  int main() {     // Bitwise AND (&)     int A = 5, B = 3;     cout << "(" << A << " & " << B << ") = " << (A & B) << endl;      // Bitwise OR (|)     cout << "(" << A << " | " << B << ") = " << (A | B) << endl;      // Bitwise XOR (^)     cout << "(" << A << " ^ " << B << ") = " << (A ^ B) << endl;      // Bitwise NOT (~)     cout << "~" << A << " = " << (~A) << endl;      // Left Shift (<<)     cout << "(" << A << " << 2) = " << (A << 2) << endl;      // Right Shift (>>)     cout << "(" << A << " >> 2) = " << (A >> 2) << endl;     return 0; } 
Java
class GFG {     public static void main(String[] args)     {         // Bitwise AND (&)         int A = 5, B = 3;         System.out.println("(" + A + " & " + B                            + ") = " + (A & B));          // Bitwise OR (|)         System.out.println("(" + A + " | " + B                            + ") = " + (A | B));          // Bitwise XOR (^)         System.out.println("(" + A + " ^ " + B                            + ") = " + (A ^ B));          // Bitwise NOT (~)         System.out.println("~" + A + " = " + (~A));          // Left Shift (<<)         System.out.println("(" + A                            + " << 2) = " + (A << 2));          // Right Shift (>>)         System.out.println("(" + A                            + " >> 2) = " + (A >> 2));     } } 
Python3
# Bitwise AND (&) A, B = 5, 3 print(f"({A} & {B}) = {A & B}")  # Bitwise OR (|) print(f"({A} | {B}) = {A | B}")  # Bitwise XOR (^) print(f"({A} ^ {B}) = {A ^ B}")  # Bitwise NOT (~) print(f"~{A} = {~A}")  # Left Shift (<<) print(f"({A} << 2) = {A << 2}")  # Right Shift (>>) print(f"({A} >> 2) = {A >> 2}") 
JavaScript
class GFG {     static main() {         // Bitwise AND (&)         let A = 5, B = 3;         console.log(`(${A} & ${B}) = ${A & B}`);          // Bitwise OR (|)         console.log(`(${A} | ${B}) = ${A | B}`);          // Bitwise XOR (^)         console.log(`(${A} ^ ${B}) = ${A ^ B}`);          // Bitwise NOT (~)         console.log(`~${A} = ${~A}`);          // Left Shift (<<)         console.log(`(${A} << 2) = ${A << 2}`);          // Right Shift (>>)         console.log(`(${A} >> 2) = ${A >> 2}`);     } }  // Call main function GFG.main(); 

Output
(5 & 3) = 1 (5 | 3) = 7 (5 ^ 3) = 6 ~5 = -6 (5 << 2) = 20 (5 >> 2) = 1

In conclusion, operators in programming are essential for tasks like math, comparison, and logical decision-making. They handle basic operations, value comparison, and variable manipulation. Understanding these is crucial for efficient coding in different languages.


Next Article
Conditional Statements in Programming | Definition, Types, Best Practices

R

RishabhPrabhu
Improve
Article Tags :
  • Programming

Similar Reads

  • Learn Programming For Free
    Programming, also known as coding, is the process of creating a set of instructions that tell a computer how to perform a specific task. These instructions, called programs, are written in a language that the computer can understand and execute. Welcome to our journey into the world of programming!
    6 min read
  • What is Programming? A Handbook for Beginners
    Diving into the world of coding might seem intimidating initially, but it is a very rewarding journey that allows an individual to solve problems creatively and potentially develop software. Whether you are interested out of sheer curiosity, for a future career, or a school project, we are here to a
    13 min read
  • How to Start Coding: A Beginner's Guide to Learning Programming
    In today's digital age, learning programming has become increasingly important. As technology continues to advance, the demand for skilled programmers across various industries is on the rise. Whether you want to pursue a career in tech, develop problem-solving skills, or simply unleash your creativ
    15+ min read
  • Basic Components of Programming

    • Data Types in Programming
      In Programming, data type is an attribute associated with a piece of data that tells a computer system how to interpret its value. Understanding data types ensures that data is collected in the preferred format and that the value of each property is as expected. Table of Content What are Data Types
      11 min read
    • Variable in Programming
      In programming, we often need a named storage location to store the data or values. Using variables, we can store the data in our program and access it afterward. In this article, we will learn about variables in programming, their types, declarations, initialization, naming conventions, etc. Table
      11 min read
    • Variable in Programming
      In programming, we often need a named storage location to store the data or values. Using variables, we can store the data in our program and access it afterward. In this article, we will learn about variables in programming, their types, declarations, initialization, naming conventions, etc. Table
      11 min read
    • Types of Operators in Programming
      Types of operators in programming are symbols or keywords that represent computations or actions performed on operands. Operands can be variables, constants, or values, and the combination of operators and operands form expressions. Operators play a crucial role in performing various tasks, such as
      15+ min read
    • Conditional Statements in Programming | Definition, Types, Best Practices
      Conditional statements in programming are used to control the flow of a program based on certain conditions. These statements allow the execution of different code blocks depending on whether a specified condition evaluates to true or false, providing a fundamental mechanism for decision-making in a
      15+ min read
    • If-Then-___ Trio in Programming
      Learning to code is a bit like discovering magic spells, and one trio of spells you'll encounter often is called "If-Then-___." These spells help your code make decisions like a wizard choosing the right spell for a particular situation. Table of Content If-Then-ElseIf-Then-TernaryIf-Then-ThrowIf-Th
      2 min read
    geeksforgeeks-footer-logo
    Corporate & Communications Address:
    A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
    Registered Address:
    K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
    GFG App on Play Store GFG App on App Store
    Advertise with us
    • Company
    • About Us
    • Legal
    • Privacy Policy
    • In Media
    • Contact Us
    • Advertise with us
    • GFG Corporate Solution
    • Placement Training Program
    • Languages
    • Python
    • Java
    • C++
    • PHP
    • GoLang
    • SQL
    • R Language
    • Android Tutorial
    • Tutorials Archive
    • DSA
    • Data Structures
    • Algorithms
    • DSA for Beginners
    • Basic DSA Problems
    • DSA Roadmap
    • Top 100 DSA Interview Problems
    • DSA Roadmap by Sandeep Jain
    • All Cheat Sheets
    • Data Science & ML
    • Data Science With Python
    • Data Science For Beginner
    • Machine Learning
    • ML Maths
    • Data Visualisation
    • Pandas
    • NumPy
    • NLP
    • Deep Learning
    • Web Technologies
    • HTML
    • CSS
    • JavaScript
    • TypeScript
    • ReactJS
    • NextJS
    • Bootstrap
    • Web Design
    • Python Tutorial
    • Python Programming Examples
    • Python Projects
    • Python Tkinter
    • Python Web Scraping
    • OpenCV Tutorial
    • Python Interview Question
    • Django
    • Computer Science
    • Operating Systems
    • Computer Network
    • Database Management System
    • Software Engineering
    • Digital Logic Design
    • Engineering Maths
    • Software Development
    • Software Testing
    • DevOps
    • Git
    • Linux
    • AWS
    • Docker
    • Kubernetes
    • Azure
    • GCP
    • DevOps Roadmap
    • System Design
    • High Level Design
    • Low Level Design
    • UML Diagrams
    • Interview Guide
    • Design Patterns
    • OOAD
    • System Design Bootcamp
    • Interview Questions
    • Inteview Preparation
    • Competitive Programming
    • Top DS or Algo for CP
    • Company-Wise Recruitment Process
    • Company-Wise Preparation
    • Aptitude Preparation
    • Puzzles
    • School Subjects
    • Mathematics
    • Physics
    • Chemistry
    • Biology
    • Social Science
    • English Grammar
    • Commerce
    • World GK
    • GeeksforGeeks Videos
    • DSA
    • Python
    • Java
    • C++
    • Web Development
    • Data Science
    • CS Subjects
    @GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
    We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
    Lightbox
    Improvement
    Suggest Changes
    Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
    geeksforgeeks-suggest-icon
    Create Improvement
    Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
    geeksforgeeks-improvement-icon
    Suggest Changes
    min 4 words, max Words Limit:1000

    Thank You!

    Your suggestions are valuable to us.

    What kind of Experience do you want to share?

    Interview Experiences
    Admission Experiences
    Career Journeys
    Work Experiences
    Campus Experiences
    Competitive Exam Experiences