₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,347,004 members, 8,526,218 topics. Date: Saturday, 28 November 2026 at 04:22 AM

Toggle theme

D34lw4p's Posts

Nairaland Forum › D34lw4p's Profile › D34lw4p's Posts

1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 30 pages)

Programming › Checking If A Number Is Odd In Java by D34lw4p(op): 10:54pm On Jan 25, 2016
Have a look at the lines of code below and determine if they can be used to precisely identify if a given number is Odd?


public boolean oddOrNot(intnum) {
return num %2==1;
}


These lines seem correct but they will return incorrect results one of every four times (Statistically speaking). Consider a negative Odd number, the remainder of division with 2 will not be 1. So, the returned result will be false which is incorrect!

This can be fixed as follows:


public boolean oddOrNot(intnum) {
return (num &1) !=0;
}


Using this code, not only is the problem of negative odd numbers solved, but this code is also highly optimized.

Since, Arithmetic and Logical operations are much faster compared to division and multiplication, the results are achieved faster so in second snippet.


Join Our Programming Discussion Forum www.nct.com.ng
Programming › Re: Would Love To Develop A Forum by D34lw4p(m): 1:01am On Jan 18, 2016
use perl
Romance › Re: Nairalanders Please Help by D34lw4p(op): 9:44pm On Jan 14, 2016
ronald4ever:
Okay. She's suitable for you age wise then. Do you like and find her attractive? If yes, then why not make her your babe, unless if you have a girlfriend already.

If no, then tell her off outrightly that you don't like those kind of moves on you and she should stop it. And be mean when saying it.
Thank you very much.
Romance › Re: Nairalanders Please Help by D34lw4p(op): 9:26pm On Jan 14, 2016
ronald4ever:
What's her age bracket? Is she older or around same age as you?
she is 18years old.
Romance › Re: Nairalanders Please Help by D34lw4p(op): 9:09pm On Jan 14, 2016
RoyalBlak007:
What year is this nollywood script
Hello please am not joking, am very serious about what am posting here.
Romance › Nairalanders Please Help by D34lw4p(op):
Hello Nairalanders, I am 19 years old there is a girl who owns a shop beside my mum's own, anytime she sees me around i noticed something strange about the way she behave, she would just hug me and even go as far as kissing me right in front of my mum. Am kind of confused cos i dont expect her to be behaving the way she is doing, she would go as far as calling me her husband and all that, there was a day she was trying to get me to have sex with her,seriously i never discussed anything about relationship with her but she has been doing this same thing for more than a year now and am totally confused on what to do.
Seriously i really like the girl but the way she is behaving toward me is too pushy cos she is doin to me what i should be doing what i should be doin to her assuming we are dating.

Please Matured Nairalander your help is needed. What do you suggest i do?
Romance › Re: I Have Decided To Run For MR NAIRALAND 2016 by D34lw4p(m): 9:11pm On Jan 10, 2016
Kayoski:
I av read the interview..
seun come and confirm if its genuine..
what will i gain if its not genuine. I only post the best in my forum.
Education › Re: please advice by D34lw4p(m): 8:17pm On Jan 10, 2016
FUTA takes 'PASS' FOR ENGLISH IF YOU WANT TO STUDY SCIENCE COURSE
Programming › Re: Andela Labs by D34lw4p(m): 7:46pm On Jan 10, 2016
post your questions at www.nct.com.ng programmers are there to help you
seu04:
Pls can someone help me with fissbuzz lab am stuck don't know what to do..
post your questions at www.nct.com.ng programmers are there to help you

1 2 3 4 5 6 7 8 ... 22 23 24 25 26 27 28 29 30 (of 30 pages)