Hi, need help on program where to find the factors of a number.. to determine if it is odd or even.
say input number is 6,
factors are: 1x 6, 6 x 1, 2 x 3, 3 x 2
The number is: Even
appreciate your outmost help. Thanks!
8 7364
Star8-
Have you tried this? What have you tried, what errors did you get?
People tend to not want to help someone who just asks for the answer and doesn't show their attempt at the problem. It also will help you learn it, because we can use your ideas and show you what you did right, what you might not have done properly.
Hi,
I already made a program and it works.
Thanks for all your effort of helping!
Awesome!
For everyone else here at TSDN who may be facing a similar problem, could you explain to us what method you used? How did you determine something was a factor? How did you determine the number was even? That way, anyone with the same assignment can find this thread and learn the method of how to do it.
Hi, need help on program where to find the factors of a number.. to determine if it is odd or even.
say input number is 36,
factors are: 36/2=18
18/2=9
9/3=3
3/3=1
2*2*3*3 (how to display this format then tell if even or odd)
The number is: Even
iansito:
As we asked Star8, what work have you done to solve this problem? Do you have any code? Do you have any ideas on how you would start writing code?
Awesome!
For everyone else here at TSDN who may be facing a similar problem, could you explain to us what method you used? How did you determine something was a factor? How did you determine the number was even? That way, anyone with the same assignment can find this thread and learn the method of how to do it.
Hi,
If (number % something) == 0, then something is a factor of number.
Modulus operator(%) gives us the remainder..then remainder 0 means something completely divides number, ie something is a factor of number.
Hi,
If (number % something) == 0, then something is a factor of number.
Modulus operator(%) gives us the remainder..then remainder 0 means something completely divides number, ie something is a factor of number.
please, this is not clear enough. assuming i want to list all the factors of number e.g
a user enters 12, the program should be able to list the factors:2, 3, 4
thanks
ib
We don't give away homework answers here. Don't hijack old threads here. Start a new one, and post your efforts. Like code you have written, or thought processes you have followed.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: kw |
last post by:
Hello,
I am trying to put up a page for my students for them to be able to enter
their class number into a field and instantly get a personalized text
message. (ie student number 5 enters "5"...
|
by: Nick |
last post by:
Hi,
How can I check if a number exists by itself in this string by using
the RegExp object?
---
var mystring = "11,111,01,011";
var match = "1";
var re = new RegExp( match );
|
by: Flack |
last post by:
Hello,
Is it possible to find out how many methods are listening to a certain
event? For example, if a number of methods subscribed to a controls DragDrop
event using +=, can I find out how many...
|
by: Flack |
last post by:
Hello,
Is it possible to find out how many methods are listening to a certain
event? For example, if a number of methods subscribed to a controls DragDrop
event using +=, can I find out how many...
|
by: frikk |
last post by:
Hey everyone,
(Sorry about the first message if it made it - i got cut off
early). I have a homework problem for my Operating Systems class. I
am supposed to use a command such as "ps -aux" and...
|
by: psbasha |
last post by:
Hi,
How to find the number of digits from a given number?.
For example
num = 23456
The number of digits are 5
num = 2311150
|
by: strife |
last post by:
Hi,
This is a homework question. I will try to keep it minimal so not to have anyone do it for me. I am really just stuck on one small spot.
I have to figure out the highest number from a users...
|
by: Bernardo |
last post by:
Okay, so I am making a program that accepts user input of integers. As you can see I am using an array and i need to get the greatest number, and smallest, range, mean, etc. But I successfully did...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |