hello, I wrote this program but I can't find the mistske.
Can you help me please? the instruction are the following :
input: 2 positive numbers (x,y)
output: the total of the numbers include in the space between (x,y)
#include <iostream>
#include <cstdlib>
#include <math.h>
#include <conio.h>
#include <stdlib.h>
usingnamespace std;
int inputdata(int &a, int &b);
int add ( int k, int b, int &s);
int main()
{
int x,y,total;
inputdata(x,y);
total=0;
add(x,y,total);
cout<<"the total of the numbers include in the space between (x,y)"<<total<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
int inputdata(int &a, int &b)
{
cout<<"write the first number"<<endl;
cin>>a;
cout<<"write the second number"<<endl;
cin>>b;
}
int add ( int k, int b, int &s)
{
int i;
for (i=k;i<b;i++)
{
s=s+1;
}
}