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");