473,386 Members | 1,699 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,386 software developers and data experts.

"successive missing page" program, who can solve?

I have a question about my subject, Borland C programming..

a book is missing successive pages. the sum of these pages is the input, and the program determines which pages are missing (the pages are successive).
for instance;
the sum of missing pages is 15, so there are several answer:
- pages 1...2...3...4...5 (1+2+3+4+5 = 15)
- pages 4...5...6 (4+5+6 = 15)
- pages 7...8 (7+8 = 15)
- and page 15 its self,

but, the program takes the first answers for output.

I need some explanation about loop.
thx,
Mar 23 '07 #1
3 1380
sicarie
4,677 Expert Mod 4TB
What sort of loop were you wanting an explanation of?
Mar 23 '07 #2
what about if I use while... it seems easier I think
Mar 24 '07 #3
Roonie
99
well, you can use any loop for any solution, so its a combination of personal preference and ease of coding that makes the decision.

why dont you try using a for loop that counts down . . . inside the loop try subtracting from the input to see if you can get a successive string of subtraction operations to work. then start the loop over again with a smaller number as its starting point.
Mar 24 '07 #4

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

Similar topics

2
by: Robin S. | last post by:
I don't have the "references" selection in my "tools" menu. Obviously this is kind of important. I have "Always show full menus" checked. Program has been updated to SP3. Any ideas as to why...
2
by: drisso | last post by:
Hello, I have searched that error on these message boards, msdn and crystaldecisions.com. I found tutorials that showed how to export a crystal report to pdf, but like many others I am getting...
9
by: ugurceng | last post by:
Hi , I wrote a project with .NET 2003 When I run the project on my local machine (http://localhost/Proje1/default.aspx) there is no problem ,but when I try to run it from any machine on my LAN ...
1
by: rb | last post by:
I'm a bit confused with this new data binding methodology - well, at least the "visual" part of it. With asp.net 1, I used be able to "mouse-my-way" around data binding instead of doing it in...
0
by: Sean Quilty | last post by:
Help! We are getting the following errors on a slave server: 060304 7:42:03 Error reading packet from server: Could not find first log (server_errno=65535) 060304 7:43:03 Slave: Failed...
1
by: BobPaul | last post by:
I'm following code out of a howto book and this is really bugging me. This header file was created by VStudio 6.0 when I did a "Right Click: Add Member Function" CLine is a class I wrote (per the...
33
by: STILL LEARNING | last post by:
I'm not sure if this can even be done, but what prompts the question is my desire to be able to create an "Uber Link" script/code of some sort, such that even if the html page contains nothing but...
11
by: MC | last post by:
I have a couple of customers who are using a program that deserializes an XML file, and on some files, the program fails to see the content of the file -- treats it as zero length and reports "root...
3
by: JFKJr | last post by:
Hello everyone, I have been trying to solve this problem from past two days. I am working for my project and stuck with this problem. Please help me out, your help will be greatly appreciated....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.