Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Operator precedence in Operators of Programming in C
1431 Views
Expression evaluation and Operators precedence 
Expressions has two sides. Two sides are joined by equal operator. Right side is the expression evaluated value assign to left side variable. Operators has precedence to perform execution.
Operators and precedence 
Operators Name Precedence
() Parenthesis First
* / % Astrick, Front slash, Percentage or Mod Second
+ - Plus and minus Third
Program Hints 
Expression: c = (a+10)*(b-5)

Step 1: (a+10)
Step 2: (b-5)
Step 3: Step 1(Result) * Step 2(Result)
Step 4: Assign value to c
Program
#include
void main(){
   int a,b;
   int c;
   a = 10; b = 20;
   c = (a+10)*(b-5);
   printf("(%d+10)*(%d-5)=%d",a,b,c);
}
Output 
(10+10)*(20-5) = 300
Previous Topics
Previous lessons of current book.
Introduction of Programming in C
Introduction of Programming in C
Introduction of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details