{"id":10466,"date":"2022-07-16T09:05:06","date_gmt":"2022-07-16T09:05:06","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=10466"},"modified":"2023-09-14T17:20:33","modified_gmt":"2023-09-14T11:50:33","slug":"operators-in-c","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/","title":{"rendered":"Microcontroller Embedded C Programming Lecture 78| Operators in &#8216;C&#8217;"},"content":{"rendered":"<div class=\"boldgrid-section\" style=\"background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"container\">\n<div class=\"row\" style=\"padding-top: 35px; padding-bottom: 0px; background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"col-md-1 col-sm-12 col-xs-12 col-lg-1\">\n<div class=\"boldgrid-shortcode\" data-imhwpb-draggable=\"true\">\n\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"col-md-10 col-sm-12 col-xs-12 col-lg-10\">\n<h1 class=\"\" style=\"text-align: center; font-size: 35px; border-width: 0px;\"><span style=\"color: #000080;\"><strong>Operators in &#8216;C&#8217;<\/strong><\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\" style=\"border-width: 0px; margin-top: -25px;\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<p>&nbsp;<\/p>\n<div class=\"bg-hr bg-hr-10 color2-color\" style=\"border-style: solid; border-width: 0px 0px 3px;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">This article focuses on understanding operators in the &#8216;C&#8217; programming language.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><strong><span style=\"color: #ff0000;\">What is an Operator?&nbsp;<\/span><\/strong><\/p>\n<p class=\"color-2-text-contrast color2-background-color\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; padding-left: 40px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #ffff00;\"><span style=\"font-weight: 400;\">An operator is a symbol that tells the compiler to perform a certain mathematical or logical manipulation on the operands.<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-size: 17px; line-height: 29px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">In other words, an operator acts as a instruction to carry out a certain operation.<\/span><\/p>\n<figure id=\"attachment_10469\" aria-describedby=\"caption-attachment-10469\" style=\"width: 544px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-10469 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-1-23-1024x521.png\" alt=\"Figure 1. Operators in \u2018C\u2019\" width=\"544\" height=\"277\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-1024x521.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-300x153.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-768x391.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-600x305.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-1536x781.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-120x61.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-500x254.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-200x102.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-400x203.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-800x407.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23-1200x610.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-1-23.png 1893w\" sizes=\"(max-width: 544px) 100vw, 544px\" \/><figcaption id=\"caption-attachment-10469\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Operators in \u2018C\u2019 types<\/span><\/figcaption><\/figure>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<h2 data-font-family=\"Roboto Slab\" data-font-weight=\"400\">&nbsp;<\/h2>\n<h2 class=\"\" style=\"font-size: 22px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\"><span style=\"color: #000080;\"><strong><span style=\"text-decoration: underline;\">Types of Operators in &#8216;C&#8217;:&nbsp;<\/span><\/strong><\/span><\/h2>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">In &#8216;C&#8217; programming language, there are various types of operators.<\/span><\/span><\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\"><span style=\"color: #ff0000;\"><strong><a style=\"color: #ff0000;\" href=\"https:\/\/fastbitlab.com\/unary-operator-in-c\/\" target=\"_blank\" rel=\"noopener\">Unary Operators:<\/a><\/strong><\/span> These operators require only one operand.<\/span>\n<ul class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">&nbsp;<\/span><span style=\"font-weight: 400;\"><a style=\"color: #000080;\" href=\"http:\/\/fastbitlab.com\/unary-operator-in-c\/\" target=\"_blank\" rel=\"noopener\">increment and decrement operators<\/a><\/span><\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\"><span style=\"color: #ff0000;\"><strong>Binary Operators: <\/strong><\/span>These operators require two operands.<\/span>\n<ul class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li aria-level=\"1\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">arithmetic operators, <a style=\"color: #000080;\" href=\"http:\/\/fastbitlab.com\/relational-operators-in-c\/\" target=\"_blank\" rel=\"noopener\">relational operators<\/a>,<a style=\"color: #000080;\" href=\"http:\/\/fastbitlab.com\/logical-operators-in-c\/\" target=\"_blank\" rel=\"noopener\"> logical operators<\/a>, <a style=\"color: #000080;\" href=\"https:\/\/fastbitlab.com\/bitwise-operators-in-c\/\" target=\"_blank\" rel=\"noopener\">bitwise operators<\/a>, assignment operators,<\/span><\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\"><span style=\"color: #ff0000;\"><strong><a style=\"color: #ff0000;\" href=\"https:\/\/fastbitlab.com\/microcontroller-embedded-c-programming-lecture-92-conditional-operator\/\" target=\"_blank\" rel=\"noopener\">Ternary Operators:<\/a><\/strong><\/span> These operators require three operands.<\/span>\n<ul class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">C<a style=\"color: #000080;\" href=\"http:\/\/fastbitlab.com\/microcontroller-embedded-c-programming-lecture-92-conditional-operator\/\" target=\"_blank\" rel=\"noopener\">onditional operators<\/a><\/span><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">It&#8217;s important to understand the different types of operators and their usage in programming to write effective and efficient code.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<h2 class=\"\" style=\"border-width: 0px; font-size: 20px; line-height: 40px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #800080;\"><strong><span style=\"text-decoration: underline;\">Arithmetic operators in C<\/span><\/strong><\/span><\/h2>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\"><span style=\"font-weight: 400; color: #000080;\">Arithmetic operators are used to perform mathematical operations in programming.<\/span><\/li>\n<li><span style=\"font-weight: 400; color: #000080;\">There are five main arithmetic operators: addition (+), subtraction (-), multiplication (*), division (\/), and modulus (%).<\/span><\/li>\n<\/ul>\n<ol class=\"\">\n<li style=\"list-style-type: none;\">\n<ol class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><strong>Addition (+):<\/strong> Adds two values.<\/span><\/li>\n<li><span style=\"color: #000080;\"><strong>Subtraction (-):<\/strong> Subtracts one value from another.<\/span><\/li>\n<li><span style=\"color: #000080;\"><strong>Multiplication (*):<\/strong> Multiplies two values.<\/span><\/li>\n<li><span style=\"color: #000080;\"><strong>Division (\/):<\/strong> Divides one value by another.<\/span><\/li>\n<li><span style=\"color: #000080;\"><strong>Modulus (%):<\/strong> Computes the remainder of a division operation.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ul class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">The modulus operator returns the remainder from division.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">For example, 14%4 evaluates to 2, meaning that when 14 is divided by 4, there is a remainder of 2.<\/span><\/li>\n<\/ul>\n<figure id=\"attachment_10470\" aria-describedby=\"caption-attachment-10470\" style=\"width: 573px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-10470 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-2-20-1024x586.png\" alt=\"Figure 2. Arithmetic(Mathematical)operators\" width=\"573\" height=\"328\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-1024x586.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-300x172.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-768x439.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-600x343.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-1536x878.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-120x69.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-500x286.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-200x114.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-400x229.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-800x457.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20-1200x686.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-2-20.png 1649w\" sizes=\"(max-width: 573px) 100vw, 573px\" \/><figcaption id=\"caption-attachment-10470\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Arithmetic(Mathematical)operators<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 20px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #800080;\"><strong>Relational Operators:<\/strong><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><code>==<\/code> (Equal to): Checks if two values are equal.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>!=<\/code> (Not equal to): Checks if two values are not equal.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>&lt;<\/code> (Less than): Checks if the left operand is less than the right operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>&gt;<\/code> (Greater than): Checks if the left operand is greater than the right operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>&lt;=<\/code> (Less than or equal to): Checks if the left operand is less than or equal to the right operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>&gt;=<\/code> (Greater than or equal to): Checks if the left operand is greater than or equal to the right operand.<\/span><\/li>\n<\/ul>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #800080;\"><strong><span>Logical Operators:<\/span><\/strong><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><code>&amp;&amp;<\/code> (Logical AND): Performs a logical AND operation between two conditions.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>||<\/code> (Logical OR): Performs a logical OR operation between two conditions.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>!<\/code> (Logical NOT): Negates a boolean expression.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #800080;\"><strong><span style=\"text-decoration: underline;\">Assignment Operators:<\/span><\/strong><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><code>=<\/code> (Assignment): Assigns the value on the right to the variable on the left.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>+=<\/code> (Addition Assignment): Adds the right operand to the left operand and assigns the result to the left operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>-=<\/code> (Subtraction Assignment): Subtracts the right operand from the left operand and assigns the result to the left operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>*=<\/code> (Multiplication Assignment): Multiplies the left operand by the right operand and assigns the result to the left operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>\/=<\/code> (Division Assignment): Divides the left operand by the right operand and assigns the result to the left operand.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>%=<\/code> (Modulus Assignment): Computes the remainder and assigns it to the left operand.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 20px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #800080;\"><strong><span style=\"text-decoration: underline;\">Increment\/Decrement Operators:<\/span><\/strong><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><code>++<\/code> (Increment): Increases the value of a variable by 1.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>--<\/code> (Decrement): Decreases the value of a variable by 1.<\/span><\/li>\n<\/ul>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #800080;\"><strong><span style=\"text-decoration: underline;\">Bitwise Operators (operate on individual bits of integer values):<\/span><\/strong><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><code>&amp;<\/code> (Bitwise AND): Performs a bitwise AND operation.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>|<\/code> (Bitwise OR): Performs a bitwise OR operation.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>^<\/code> (Bitwise XOR): Performs a bitwise XOR (exclusive OR) operation.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>~<\/code> (Bitwise NOT): Inverts the bits of a value.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>&lt;&lt;<\/code> (Left Shift): Shifts the bits to the left.<\/span><\/li>\n<li><span style=\"color: #000080;\"><code>&gt;&gt;<\/code> (Right Shift): Shifts the bits to the right.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 20px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #800080;\"><strong><span style=\"text-decoration: underline;\">Conditional (Ternary) Operator:<\/span><\/strong><\/span><\/p>\n<ul class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li><span style=\"color: #000080;\"><code>? :<\/code> (Conditional Operator): Provides a concise way to write if-else statements.<\/span><\/li>\n<\/ul>\n<p class=\"\">&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 23px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><strong><span style=\"text-decoration: underline;\">Example:<\/span><\/strong><\/span><\/p>\n<figure id=\"attachment_10472\" aria-describedby=\"caption-attachment-10472\" style=\"width: 621px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-10472 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-3-16-1024x209.png\" alt=\"Figure 3. Example\" width=\"621\" height=\"127\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-1024x209.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-300x61.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-768x157.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-600x123.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-1536x314.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-120x25.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-500x102.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-200x41.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-400x82.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-800x163.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16-1200x245.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-3-16.png 1777w\" sizes=\"(max-width: 621px) 100vw, 621px\" \/><figcaption id=\"caption-attachment-10472\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Example<\/span><\/figcaption><\/figure>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">To evaluate the expression 2 + 3 * 4, it is important to understand the <strong>operator precedence rule<\/strong>. <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">This rule determines the order in which operations are performed in an expression.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">The value stored in the variable <\/span><span style=\"font-weight: 400;\">value<\/span><span style=\"font-weight: 400;\"> after this expression is initialized to <\/span><span style=\"font-weight: 400;\">2 + 3 * 4<\/span><span style=\"font-weight: 400;\"> is 14. This is because, according to the operator precedence rule, the multiplication operator <\/span><span style=\"font-weight: 400;\">*<\/span><span style=\"font-weight: 400;\"> has a higher priority than the addition operator <\/span><span style=\"font-weight: 400;\">+<\/span><span style=\"font-weight: 400;\">. So, <\/span><span style=\"font-weight: 400;\">3 * 4<\/span><span style=\"font-weight: 400;\"> is performed first, giving us <\/span><span style=\"font-weight: 400;\">12<\/span><span style=\"font-weight: 400;\">. Then, <\/span><span style=\"font-weight: 400;\">2 + 12<\/span><span style=\"font-weight: 400;\"> is performed, giving us the final result of <\/span><span style=\"font-weight: 400;\">14<\/span><span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">In conclusion, to accurately evaluate an expression, it is necessary to understand and follow the operator precedence rule.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px;\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; border-width: 0px; line-height: 40px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #c93618;\"><b>Operator precedence<\/b><\/span><\/p>\n<blockquote class=\"\">\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"color: #c93618;\"><b><i>Operator precedence<\/i><\/b><\/span><span style=\"font-weight: 400;\"> rules determine which mathematical operation takes place first, i.e. takes precedence over others. Parentheses,(), may be used to force an expression to higher precedence.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<\/blockquote>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">Operator precedence is the order in which operations are performed in an expression.<\/span><\/p>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #800080;\"><strong>Operators precedence table<\/strong><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">A table of operator precedence can be found on websites such as<span style=\"color: #ff6600;\"> <a style=\"color: #ff6600;\" href=\"http:\/\/cppreference.com\" target=\"_blank\" rel=\"noopener\">cppreference.com<\/a><\/span>. <\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">It is important to note that you do not need to memorize this table. If you want to change the order of operations, you can use parentheses to increase the precedence of the desired operator in an expression.<\/span><\/p>\n<figure id=\"attachment_10473\" aria-describedby=\"caption-attachment-10473\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10473 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-4-15-1024x605.png\" alt=\"Figure 4. Operators precedence table\" width=\"677\" height=\"400\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-1024x605.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-300x177.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-768x453.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-600x354.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-1536x907.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-120x71.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-500x295.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-200x118.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-400x236.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-800x472.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15-1200x708.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-4-15.png 1821w\" sizes=\"(max-width: 677px) 100vw, 677px\" \/><figcaption id=\"caption-attachment-10473\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Operators precedence table<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<ol class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">This helps to determine the correct evaluation order of the expression.Precedence refers to the priority of the operator in an expression. The operator with the lower precedence value has a higher priority.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">In the example, the addition operator (+) has a precedence of 4 and the division operator (\/) has a precedence of 3. This means that in an expression with both operators, the division operator has higher priority.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">Multiplication and division have the same precedence value, so it is necessary to use associativity to evaluate the expression.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">Associativity refers to the order in which the expression should be evaluated, either from left to right or right to left.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400; color: #000080;\">Associativity is only used when two operators of the same precedence are encountered.<\/span><\/li>\n<\/ol>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 25px; border-width: 0px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #ff0000;\"><strong>Examples:<\/strong><\/span><\/p>\n<figure id=\"attachment_10474\" aria-describedby=\"caption-attachment-10474\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10474 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-5-14-1024x506.png\" alt=\"Figure 5. Examples\" width=\"600\" height=\"297\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-1024x506.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-300x148.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-768x379.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-600x296.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-1536x759.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-120x59.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-500x247.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-200x99.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-400x198.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-800x395.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14-1200x593.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-5-14.png 1759w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-10474\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Examples<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Let&#8217;s consider this expression <\/span><b>2+3*4<\/b><span style=\"font-weight: 400;\">. This evaluates to 14, not to 20. Let&#8217;s understand how.<\/span><\/span><\/p>\n<figure id=\"attachment_10475\" aria-describedby=\"caption-attachment-10475\" style=\"width: 663px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10475 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-6-13-1024x517.png\" alt=\"Figure 6. Solution\" width=\"663\" height=\"335\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-1024x517.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-300x151.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-768x388.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-600x303.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-1536x775.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-120x61.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-500x252.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-540x272.png 540w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-200x101.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-400x202.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-800x404.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13-1200x606.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png 1797w\" sizes=\"(max-width: 663px) 100vw, 663px\" \/><figcaption id=\"caption-attachment-10475\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Solution<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Let&#8217;s take the first expression, <\/span><b>2+3*4<\/b><span style=\"font-weight: 400;\">. Here, the multiplication operator has a higher precedence level than the addition operator. That&#8217;s why <\/span><b>3*4<\/b><span style=\"font-weight: 400;\"> is evaluated first. So, you get <\/span><b>12<\/b><span style=\"font-weight: 400;\"> here. Then, <\/span><b>2+12<\/b><span style=\"font-weight: 400;\">. That&#8217;s why the result would be <\/span><b>14<\/b><span style=\"font-weight: 400;\">.&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">There are two operators, addition and multiplication, and the multiplication operator has higher precedence. That&#8217;s why its operands are considered first.&nbsp;<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Now let&#8217;s proceed to the following expression. The expression is <\/span><b>(2+3)*4<\/b><span style=\"font-weight: 400;\">. <\/span><\/span><\/p>\n<figure id=\"attachment_10476\" aria-describedby=\"caption-attachment-10476\" style=\"width: 654px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10476 \" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-7-11-1024x510.png\" alt=\"Figure 7. Solution\" width=\"654\" height=\"326\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-1024x510.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-300x149.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-768x383.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-600x299.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-1536x765.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-120x60.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-500x249.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-200x100.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-400x199.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-800x399.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11-1200x598.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-7-11.png 1881w\" sizes=\"(max-width: 654px) 100vw, 654px\" \/><figcaption id=\"caption-attachment-10476\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 7. Solution<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Here <\/span><b>2 + 3<\/b><span style=\"font-weight: 400;\"> is inside the parentheses and multiplied by <\/span><b>4<\/b><span style=\"font-weight: 400;\">. If you check this table(Figure 4), parentheses have higher precedence. Its precedence is 1. So, addition or multiplication. So parentheses has higher precedence. That&#8217;s why parentheses will be evaluated first.&nbsp; So, what is there inside the parentheses will be valued at first. Here you are promoting the precedence of the addition operator. That&#8217;s why <\/span><b>2 + 3<\/b><span style=\"font-weight: 400;\"> will be evaluated first. That is <\/span><b>5<\/b><span style=\"font-weight: 400;\">. And after that, it is carried out 20.&nbsp;<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Let&#8217;s consider another expression, <\/span><b>4*5\/2*5<\/b><span style=\"font-weight: 400;\">. What do you think, 2 or 50? Let&#8217;s see that. <\/span><\/span><\/p>\n<figure id=\"attachment_10477\" aria-describedby=\"caption-attachment-10477\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10477\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-8-10-1024x541.png\" alt=\"Operators in C\" width=\"575\" height=\"304\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-1024x541.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-300x158.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-768x405.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-600x317.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-1536x811.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-120x63.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-500x264.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-200x106.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-400x211.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-800x422.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10-1200x633.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-8-10.png 1847w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><figcaption id=\"caption-attachment-10477\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. Solution<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">First of all, there are 2 operators, multiplication and division. Both multiplication and division have the same precedence level. That is 3(Look at the table). That means there is a conflict. To solve this conflict, you must use associativity(Figure 8).<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Associativity comes into the picture only when there is a conflict between 2 operators that have the same precedence level conflict. Here the multiplication and division have the same precedence level, so you have to consider the associativity now. The associativity is from left to right. That&#8217;s why to evaluate <\/span><b>4*5\/2*5<\/b><span style=\"font-weight: 400;\">, this expression and the compiler start from the left. And when it starts from the left, it first encounters a multiplication operation. That&#8217;s why it considers <\/span><b>4*5<\/b><span style=\"font-weight: 400;\"> operands first. So, you got <\/span><b>20<\/b><span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">And after that, again, there are two operators of the same precedence level: division and multiplication. So again, left to right, the compiler encounters division first. <\/span><b>20\/2<\/b><span style=\"font-weight: 400;\"> of these operands are considered. The result will be <\/span><b>10<\/b><span style=\"font-weight: 400;\">. After that, <\/span><b>10 * 5<\/b><span style=\"font-weight: 400;\">, which is <\/span><b>50.<\/b><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Associativity is used to evaluate the expression when there are two or more operators of the same precedence is present in an expression.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Now let&#8217;s consider <\/span><b>12+3-4\/2&lt;3+1<\/b><span style=\"font-weight: 400;\">. This expression looks a little complicated, but you can apply the precedence rules and solve this equation. But remember that never think of remembering the precedence level of different operators. So, that is absolutely not required. Don&#8217;t try to memorize the operators precedence level.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">In an expression, if you want to promote the precedence of an operator of your choice just use parentheses. Never try to memorize precedence levels of operators.<\/span><\/p>\n<figure id=\"attachment_10478\" aria-describedby=\"caption-attachment-10478\" style=\"width: 566px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10478\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2022\/07\/Figure-9-8-1024x554.png\" alt=\"Operators n C\" width=\"566\" height=\"306\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-1024x554.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-300x162.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-768x416.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-600x325.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-1536x831.png 1536w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-120x65.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-500x271.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-200x108.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-400x216.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-800x433.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8-1200x649.png 1200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-9-8.png 1839w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><figcaption id=\"caption-attachment-10478\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 9. Solution<\/span><\/figcaption><\/figure>\n<p data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Let&#8217;s see how we can evaluate this expression using the precedence rule. First, we have a couple of operators here, <\/span><b>+<\/b><span style=\"font-weight: 400;\">, <\/span><b>&#8211;<\/b><span style=\"font-weight: 400;\">, <\/span><b>\/<\/b><span style=\"font-weight: 400;\">, <\/span><b>&lt;<\/b><span style=\"font-weight: 400;\">.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">And if you look into the precedence chart, the division has higher precedence. Then addition and subtraction. After that, less than and greater than symbols they have the lower precedence.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">That&#8217;s why division is done first here. <\/span><b>4\/2<\/b><span style=\"font-weight: 400;\"> operands are considered. That gives you <\/span><b>12+3-2&lt;3+1<\/b><span style=\"font-weight: 400;\"> this expression.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">Here we have now <\/span><b>+<\/b><span style=\"font-weight: 400;\"> and <\/span><b>&#8211;<\/b><span style=\"font-weight: 400;\">. There is a conflict. So, whenever there is a conflict, the conflict is whether to do <\/span><b>3 &#8211; 2<\/b><span style=\"font-weight: 400;\"> first or <\/span><b>12 + 3<\/b><span style=\"font-weight: 400;\"> first. So, that&#8217;s a conflict. To solve this conflict, check the associativity of addition and subtraction, which is left to right. That&#8217;s why the compiler evaluates this expression from left to right. So, it encounters addition first. That gives you <\/span><b>15-2&lt;3+1<\/b><span style=\"font-weight: 400;\"> this expression.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\"><span style=\"color: #000080;\">And again, there is a conflict here between the <\/span><\/span><span style=\"color: #000080;\"><b>15-2<\/b><span style=\"font-weight: 400;\"> operation and the <\/span><b>3+1<\/b><span style=\"font-weight: 400;\"> operation. Again use left to right associativity. The compiler considers <\/span><b>15-2<\/b><span style=\"font-weight: 400;\"> operands first. That&#8217;s why you get <\/span><b>13&lt;3+1<\/b><span style=\"font-weight: 400;\"> expression here. Now, in this expression, addition has the highest precedence. So, <\/span><b>3 + 1<\/b><span style=\"font-weight: 400;\">, that is <\/span><b>4<\/b><span style=\"font-weight: 400;\">.<\/span><\/span><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><span style=\"font-weight: 400;\">After that,<\/span><b>13&lt;4<\/b><span style=\"font-weight: 400;\"> is the final expression, which is a relational statement.&nbsp; <\/span><b>13 &lt; 4<\/b><span style=\"font-weight: 400;\"> evaluates to <\/span><b>0<\/b><span style=\"font-weight: 400;\">. That is false. Hence, the result is <\/span><b>0<\/b><span style=\"font-weight: 400;\"> here.&nbsp;<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000080;\">Remember that all arithmetic operators are binary operators. i.e., they need at least two operands to operate.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\"><span style=\"color: #000080;\">In the following article, let&#8217;s understand<\/span> <span style=\"color: #ff6600;\"><a class=\"\" style=\"color: #ff6600;\" href=\"http:\/\/fastbitlab.com\/unary-operator-in-c\/\" target=\"_blank\" rel=\"noopener\">unary operators in &#8216;C&#8217;<\/a><\/span>.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 20px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><b>FastBit Embedded Brain Academy Courses<\/b><\/span><\/p>\n<p class=\"\" style=\"font-size: 18px; border-width: 0px;\"><span style=\"color: #000000;\">C<span style=\"font-weight: 400;\"><span style=\"color: #000000;\">lick here:<\/span>&nbsp;<\/span><\/span><span style=\"color: #0000ff;\"><a style=\"color: #0000ff; text-decoration: underline;\" href=\"http:\/\/fastbitlab.com\/course1\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">https:\/\/fastbitlab.com\/course1<\/span><\/a><\/span><\/p>\n<p class=\"\" style=\"padding-left: 40px;\">&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Operators in &#8216;C&#8217; &nbsp; &nbsp; This article focuses on understanding operators in the &#8216;C&#8217; programming language. What is an Operator?&nbsp; An operator is a symbol that tells the compiler to perform a certain mathematical or logical manipulation on the operands. In other words, an operator acts as a instruction to carry out a certain [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10475,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[16],"class_list":["post-10466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-microcontroller-embedded-c-programming","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Operators in C Programming: Types, Precedence and Examples<\/title>\n<meta name=\"description\" content=\"Operators &#039;C&#039; programming language. Discover the world of &#039;C&#039; operators, from understanding operator precedence to practical examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/operators-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Operators in C Programming: Types, Precedence and Examples\" \/>\n<meta property=\"og:description\" content=\"Operators &#039;C&#039; programming language. Discover the world of &#039;C&#039; operators, from understanding operator precedence to practical examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/operators-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-16T09:05:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-14T11:50:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1797\" \/>\n\t<meta property=\"og:image:height\" content=\"907\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"Microcontroller Embedded C Programming Lecture 78| Operators in &#8216;C&#8217;\",\"datePublished\":\"2022-07-16T09:05:06+00:00\",\"dateModified\":\"2023-09-14T11:50:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/\"},\"wordCount\":1651,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-6-13.png\",\"keywords\":[\"Microcontroller Embedded C programming Lectures\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/\",\"name\":\"Operators in C Programming: Types, Precedence and Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-6-13.png\",\"datePublished\":\"2022-07-16T09:05:06+00:00\",\"dateModified\":\"2023-09-14T11:50:33+00:00\",\"description\":\"Operators 'C' programming language. Discover the world of 'C' operators, from understanding operator precedence to practical examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-6-13.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/Figure-6-13.png\",\"width\":1797,\"height\":907,\"caption\":\"Figure 6. Solution\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/operators-in-c\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microcontroller Embedded C Programming Lecture 78| Operators in &#8216;C&#8217;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Operators in C Programming: Types, Precedence and Examples","description":"Operators 'C' programming language. Discover the world of 'C' operators, from understanding operator precedence to practical examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Operators in C Programming: Types, Precedence and Examples","og_description":"Operators 'C' programming language. Discover the world of 'C' operators, from understanding operator precedence to practical examples.","og_url":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2022-07-16T09:05:06+00:00","article_modified_time":"2023-09-14T11:50:33+00:00","og_image":[{"width":1797,"height":907,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"Microcontroller Embedded C Programming Lecture 78| Operators in &#8216;C&#8217;","datePublished":"2022-07-16T09:05:06+00:00","dateModified":"2023-09-14T11:50:33+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/"},"wordCount":1651,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png","keywords":["Microcontroller Embedded C programming Lectures"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/operators-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/","url":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/","name":"Operators in C Programming: Types, Precedence and Examples","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png","datePublished":"2022-07-16T09:05:06+00:00","dateModified":"2023-09-14T11:50:33+00:00","description":"Operators 'C' programming language. Discover the world of 'C' operators, from understanding operator precedence to practical examples.","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/operators-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2022\/07\/Figure-6-13.png","width":1797,"height":907,"caption":"Figure 6. Solution"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/operators-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microcontroller Embedded C Programming Lecture 78| Operators in &#8216;C&#8217;"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=10466"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10466\/revisions"}],"predecessor-version":[{"id":10826,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/10466\/revisions\/10826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/10475"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=10466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=10466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=10466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}