Posts

Showing posts from November 16, 2019

Arithmetic operators

Arithmetic operators are: * (Multiply), /(divide), %(Modulas)- It's priority is most + -          It's priority is least. i) Multiplication Operator : This operator multiplies two operands. If in any expression if there is * (multiplication) and + (Addition). Then according to precedence rule * (multiplication) is first solved. If in arithmetic operators, operators are the same then it is solved from left to right. i.e its associativity is left to right. Program #include <stdio.h> #include<conio.h> int main() {     int a;     a=2*3;     printf("Answer of multiplication operator is %d",a);     getch(); } Output: Answer of multiplication operator is 6 ii) Integer divide Operator : Examples:  2/3 ? = 0 Instead of 0.6. 13/2 =6 instead of 6.5. Because in c language if any operations are performed between two integers. then, our result will be in integer. Program:...

Popular posts from this blog

Getting input in C

Unary Operator