division tag

2 questions


1 answers
80 views
0
To divide two integers and save them as prime numbers?

I thought 0.5 would come out if I said 1/2, but 0 came outIf you divide two integers, you just cut off the decimal pointWhen a and b are int c = a/bHow do we get c to float as a result?a = 1b = 2print...


1 answers
84 views
0
Which is the better way to divide an integer by 2?

Which one is better between the two methods below? Please write down the reason, tooint x = 3;x = x >> 1;x = x / 2;

2 years ago

© 2024 OneMinuteCode. All rights reserved.