Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
assignement question
Amisha Shah
Ranch Hand
Posts: 33
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
question:
x=32*(31-10*3);
a) 32
b) 31
c) 3
d) 704
e) none of the above
please tell me what is the right answer. i think , datatype of x is not given so ans would be e. but i am not sure.
Amisha Shah.<br />SCJP 1.4
Kj Reddy
Ranch Hand
Posts: 1704
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You should
assume x is int type and answer is a(32)
Petrus Pelser
Ranch Hand
Posts: 132
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Answer is a(32).
Valentin Jacquemin
Ranch Hand
Posts: 35
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
* has more precedence than - and + and when we use parantheses we can change precedence...
so:
x=32*(31-10*3);
1. 10*3=30
2. 31-30=1
3. 32*1=32
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how do we evaluate this???(shift operator)
float confusion
bit representation of integers
The Shift Operators
Unsigned right bit shift operator
More...