473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Program for finding factors of a number

2
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!
Feb 8 '07 #1
8 7364
sicarie
4,677 Expert Mod 4TB
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.
Feb 8 '07 #2
Star8
2
Hi,

I already made a program and it works.
Thanks for all your effort of helping!
Feb 17 '07 #3
Ganon11
3,652 Expert 2GB
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.
Feb 17 '07 #4
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
Apr 8 '07 #5
Ganon11
3,652 Expert 2GB
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?
Apr 8 '07 #6
cpp
5
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.
Apr 10 '07 #7
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
Oct 29 '07 #8
oler1s
671 Expert 512MB
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.
Oct 29 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
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"...
6
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 );
0
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...
1
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...
2
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...
1
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
10
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...
5
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...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
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...
0
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...
0
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...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.