search
Log In
1 vote
86 views
Which operator has higher priority between *and /  in any expression how to evaluate them
in Programming
edited by
86 views

3 Answers

2 votes

see, both having the same priority, you have to evaluate start always from left to right, here I have  taken an

infix to postfix example to understand it.... see.. hope u can easily understand.

1 vote

they have same priority ... evaluate left to right or right to left according to associativity... refer:https://www.geeksforgeeks.org/c-operator-precedence-associativity/

0 votes
  • * and / both have same priority . 
  • Evalutation is left to right

Example

a*b/c ----> ab*c/

a/b*c----> ab/c*

Related questions

0 votes
0 answers
1
99 views
char c = 'Z'; char a[] = "Hello world"; char *ptr1 = &c; char *ptr2 = a; char *ptr3 = &a[0]; char *ptr4 = &a[6]; char *ptr5 = a + 6; Can someone explain this...
asked Feb 27, 2018 in Programming Ahsanul Hoque 99 views
0 votes
0 answers
2
173 views
Can someone explain why this is happening. I have found post increment has higher precedence than pre-increment . And Post increment is left associative and pre-increment is right associative. For the 1st printf it it is 5,6 but the 2nd printf it is 6,7 Why in post increment both statemet has differenet value. https://www.geeksforgeeks.org/c-operator-precedence-associativity/
asked May 7, 2018 in Programming Abhijit Sen 4 173 views
0 votes
0 answers
3
131 views
How Format specifiers in C works? If the Code is : #include <stdio.h> int main(void) { // your code goes here char *s= "First Name"; int x= 12345; printf("%-15s%c\n", "First Name", ':'); printf("%-15s%c\n", "Last Name", ':'); printf("%-15s%c\ ... and hence the 3 zeros, but due to the 10 its length should be 10 minimum so should get more spaces. code is here also :https://ideone.com/Mo5jwf
asked Jun 27, 2018 in Programming s9k96 131 views
0 votes
3 answers
4
835 views
What is the value of the arithmetic expression (Written in C) 2*3/423/4* 2 (A) 0 (B) 1 (C) 1.5 (D) None of the above
asked Apr 2, 2017 in Programming rohini 835 views
...