473,505 Members | 16,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

urgent!

2 New Member
I need help with c program in combinatorics! I has lost file, and i forget what did i write last time, but i try to write some, so following is my code:
/* Program to calculate mutiplication for triple of integer that sum up to a total_length */

#include <stdio.h>
#define TOTAL_LENGTH 100

int main(void)
{
float x,y,z,total_length;
float orig_x,orig_y,orig_z;
int cnt=0,i,j,k,n;
int status;

printf("This program to calculate mutiplication for triple of integer that sum up to a total_length");

do {
printf("Enter an number x:");
status = scanf("%f",&x);
printf("Enter an number y:");
status = scanf("%f",&y);
printf("Enter an number z:");
status = scanf("%f",&z);
}
orig_x=x;
orig_y=y;
orig_z=z;
total_length=100

for(i=0;i<=n;++i)
for(j=0;j<=n;++j)
for(k=0;j<=n;++k)
if(i*x+j*y+k*z==total_length) {
printf("\n Calculating the program\n\n");
printf("\ni*x+j*y+k*z=100\n\n");
Sep 20 '06 #1
3 1372
Banfa
9,065 Recognized Expert Moderator Expert
What happens when you compile/run it?

You seem to detect the answer but not output the values of the variables concerned
Sep 20 '06 #2
jing
2 New Member
Hi:
Actually Last time it runs, but seem vaid. But I can't remember what other staff I write. It is a combitorirics. mautiple of three defferent numbers to sum up to a total length. for eg: 1 integer times 1 number+1 integer times another number+1 integer times another defference integer.
Sep 21 '06 #3
Banfa
9,065 Recognized Expert Moderator Expert
The only error I can see is that you don't seem to assign a value to n and that when you have found a solution you do not print out the values of the variables involved for that solution.
Sep 21 '06 #4

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

Similar topics

3
2401
by: Rob | last post by:
I have a form - when you click the submit button, it appends a variable to the URL (e.g. xyz.cgi?inputID=some_dynamic_variable) It also opens a new page. Now, that some_dynamic_variable is...
9
4280
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
8
5208
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
28
2999
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
2891
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
7
7224
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
33
3362
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
8
2750
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
3
6433
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
7
5944
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
7218
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
7103
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
7307
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
7370
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...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.