CS Chapter 4: Operators in C programming Lesson 4

16 views5 pages
25 Nov 2021
Department
Course
Professor

Document Summary

An operator is a symbol used to perform operations in a given programming language. Special symbols that are used to perform actions or operations are known as operators. For example, the symbol plus (+) is used to perform addition so it is an operator. Arithmetic operators are used to perform mathematical operations such as addition, subtraction etc. Few of the simple arithmetic operators are : We know their purpose and how they are used in simple mathematics. Their purpose and functionality are the same, let"s see their implementation in c. int a = 2; int b = 3; printf("a + b = %d\n", a+b); The output will be: a + b = 5. Relational operators are used for the comparison between two or more numbers. C also has six relational operators and their return value is in boolean i. e. either true or false (1 or 0). Implimentation int a = 2; int b = 2;