Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 135,981 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,290 people online right now. Registration is fast and FREE... Join Now!




need help writing deterministic program

 
Reply to this topicStart new topic

need help writing deterministic program, need help with looped behavior

nightgamer360
5 Jul, 2007 - 09:00 AM
Post #1

New D.I.C Head
*

Joined: 8 Feb, 2007
Posts: 19


My Contributions
I am trying to write a program with little programming experience. What i want it to do is repeatedly add a number to each answer and divide each answer by a specific number listing the result, i want it to be able loop it to continuously add the number and accept large numbers.

is this possible? doing some number research for example

divide each answer by 1-15 and if any of the numbers divide by a number lower than 15 not divide
and list the answer but if it divides by 15 list the answer.

20+60=80
80+60=140
140+60=200

and have it continously do it (having the repeatedly added numbers get larger and larger)
breaking only if i hit say the spacebar while not closing the program
out. Id like to be able to cut and paste the number answers as well as view the answers.

Idealy id like to be able to divide each answer generated by a range of numbers say
numbers 1-15 and if the number answers divide by any of the numbers 1-14 have them not list the answer,
if the answer only divides by 15 have it divide the answer and list the product to specificaly target.


any help much appreciated im using bloodshed dev kit as my compiler. Id like to have the numbers
generated get as large as possible.

This post has been edited by nightgamer360: 5 Jul, 2007 - 09:20 AM
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Need Help Writing Deterministic Program
5 Jul, 2007 - 09:05 AM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 3,983



Thanked: 16 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
sounds like a school assignment, otherwise i see no point in the program. We have a strict policy where you must supply good faith code. Known as an attempt to solve the problem, and we can help solve errors and problems you may encounter.

Yes the program is possible assuming the value does not get larger than int, double, long, or whatever range you wish to use.
User is online!Profile CardPM
+Quote Post

nightgamer360
RE: Need Help Writing Deterministic Program
5 Jul, 2007 - 09:23 AM
Post #3

New D.I.C Head
*

Joined: 8 Feb, 2007
Posts: 19


My Contributions
QUOTE(William_Wilson @ 5 Jul, 2007 - 10:05 AM) *

sounds like a school assignment, otherwise i see no point in the program. We have a strict policy where you must supply good faith code. Known as an attempt to solve the problem, and we can help solve errors and problems you may encounter.

Yes the program is possible assuming the value does not get larger than int, double, long, or whatever range you wish to use.


thanks no im a math theorist and id rather write the program or have it written rather than
argue some mathematics as im going to get alot of scoffers. alot of negativity in forums smile.gif. but thank you at least i know its possible.

how large are the numbers generated possible?
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Need Help Writing Deterministic Program
5 Jul, 2007 - 09:46 AM
Post #4

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 3,983



Thanked: 16 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
assuming a 32bit version it has a maximum value of 32 bits in an unsigned long of 4294967295

CODE

unsigned long l1 = 4294967295; //ok
unsigned long l2 = 4294967296; //either error, warning or 0

User is online!Profile CardPM
+Quote Post

nightgamer360
RE: Need Help Writing Deterministic Program
5 Jul, 2007 - 10:35 AM
Post #5

New D.I.C Head
*

Joined: 8 Feb, 2007
Posts: 19


My Contributions
QUOTE(William_Wilson @ 5 Jul, 2007 - 10:46 AM) *

assuming a 32bit version it has a maximum value of 32 bits in an unsigned long of 4294967295

CODE

unsigned long l1 = 4294967295; //ok
unsigned long l2 = 4294967296; //either error, warning or 0


thanks for that info-j
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:35AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month