1. ## Simple program

Hey guys just trying to write a simple program where I ask the user to in 2 number.
So if the user puts the 8 first and then let say 2
i print back the result 1 and 7,2 and 6,3 and 5,basically what ever adds up to 8
So I have my printf and scanf wrote and variable stored and I'm the best way to do get my ansewr is to pass my variable to a function
Something like int calculate(int total,int variations)
but this is where I'm getting bogged down,like i have my total which is equal to 8
but I dunno how to get my numbers equaling to it,maybe use an array or something or a bunch of if/else statements,I dunno

From what I can gather, though I am probably mistaken, is that you are trying to write a program that takes 2 integer inputs, the first of which is the sum. The second number I believe is the amount of numbers that you want to add together to reach the sum?

Code:
```#include <stdio.h>
#include <math.h>

int total;
int numbers;
int calculate(x,y);
int amount;

int main()
{
printf("Enter the total :\n");
scanf("%i", &total);

printf("Enter the number of combinations:\n");
scanf("%i", &numbers);

amount=calculate(total,numbers);
printf("The possible combinations for total are %i",amount);
}

int calculate(x,y)
{

}```
////////////////////////////////////
My sample output would be
Enter the total:
6
Enter the number of combinations:
2

The possible combinations for total are

1 and 5
2 and 4
///////////////////////////////////////////////
I'm going to limit my total allowed entered in staring off to be 9 and combinations 2 to make it easier starting and then increase them as I go on.
Just with my is there an easy way to find the sum of a specific number or will I have to make a big massive array or something?