Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
c
« Previous
Next »
int z,x=5,y=-10,a=4,b=2;
z = x++ - --y * b / a;
Value of z:
Options
- 10
- 11
- 12
- 5
- 6
CORRECT ANSWER : 10
Discussion Board
RULE
why aren''t we following BODMAS rule
PRAVIN 08-31-2018 01:30 AM
increment and decrement
This platform is very useful for me. But i can''t clearly understand the discussion board explanation becoz --10 value is 9 why you should increement the value as 11.pls give a clear explanation.
udhaya 09-12-2017 06:01 AM
Correct Explanation
z= x++ - --y * b / a;
z= 5++ - (-- -10) *2/4
z= 5++ - (-11*2) /4 // decrement of -10 is -11
z= 5++ - (-22/4)
z= 5++ - (-5)
z= 5++ + 5
z= 5++ + 5
z= 10 //5++ will be incremented after operation on 5 is done
//value of x will be 6 after it assigns value of z to be 10.
Arif 11-15-2016 02:26 PM
this answer 10
this progaram is using the operaters . so operater in *,/,+,_ on alpbet order.
PRAKASH.k 11-3-2014 12:01 AM
i think
5++ - --(-10)*2/4
5++ - --(-10)*0.5 // explicitly type casting to float
5++ - (-11)*0.5
5++ - (-5.5)
5 + 5.5
10.5
10 // explicitly type casting to int
hmmm 10-20-2014 06:35 AM
How???
Why you haven't increment 5++ ???????
Suganya 10-12-2014 12:11 AM
++ and -- having more precedence than * and / so.........
explantion give progam
z=5++ - -- -10*2/4
z=5++ - -11*2/4
z=5++ - -22/4
z=5++ - -5
z=5++ + 5
z=10
shankar 08-15-2014 03:29 AM
ee
its a nice platform to build one's basics. you should display the result of every ques.
chandraditya jha 07-19-2014 09:34 AM
explantion give progam
z=5++ - -- -10*2/4
z=5++ - -- -20/4
z=5++ - -- -5
z=5++ + 5
z=10
sarath 07-2-2014 01:34 AM
math
bal
bob biswas 09-16-2013 05:08 PM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
C test (42)
C (12)
C++ for beginners (10)
C++ (20)
C++ (24)
C++ (18)
C++ (14)
C++ (12)
C++ (15)
C++ (15)
Data structure (20)
Data structure (10)
Data structure (10)
Data structure (10)
PERL (25)
VC++ (11)
Oops (30)
Mainframe (41)
Mainframe (15)
Embedded systems (15)
OOAD (49)
Advertisement
▲