Code:
#include <stdio.h>
int x
int y
int add_num(int x, int y)
int sub_num(int x, int y)
int mutli_num(int x, int y)
int divid_num(int x, int y)
int add_num = +=;
int sub_num = -=;
int multi_num = *=;
int divid_num = /=;
{
int result;
result = x"+=,-=,*=,/="y;
return result;
}
As far as I can tell you are trying to make a set of functions. The way you have it laid out won't work. You have to match the routines the function is made of with the declarations. That should be:
Code:
int x;
int y;
// Placed code to right for smaller size
int add_num(int x, int y) {int add_num = +=;}
int sub_num(int x, int y) {int sub_num = -=;}
int mutli_num(int x, int y) {int multi_num = *=;}
int divid_num(int x, int y) {int divid_num = /=;}
The section with the result is not used so I didn't make changes to that.
The next error I see is this:
Code:
sum = add_num,sub_num,multi_num,divid_num(x,y);
That isn't going to do what you expect. Since I'm assuming you want the sum from adding all of those, here's what you might want to try:
Code:
sum = add_num(x,y) + sub_num(x,y) + multi_num(x,y) + divid_num(x,y);
To output a string, change:
Code:
printf("input:">>name>>\n");
to:
Code:
printf("input: %s \n", name);
Oh and add a semicolon to this:
Hope I got everything but I may have missed something.