Im working on a program and I am having sort of a design problem with it and was wondering if I could get some ideas on how to solve this problem.
Basicly I want to be able to type two numbers on the screen using scanf and have a add function add the two numbers together and give me the result on the screen. The problem is I don't know how to go about this. Here's what i have so far:
Each time you want another number, you have to manually change the number in the add function in main and re-compile it. Thats not what I want.Code:#include <stdio.h> int add(int addx, int add_y); int main() { int i; i = add(10,5); printf("The answer is %d\n", i); return 0; } int add(int add_x, int add_y) { return (add_x + add_y); }