This code compiles and runs but the results are not correct. Also, i had to put in getchar() everytime i had to hit enter if not the screen just disappears!
Help pls anyone?
Thanks so much!
-Dub
Below is the simple code:
#include <stdio.h>
int sum(int, int);
int main()
{
int i,j;
int add;
printf("Pls enter the digits you would like to add: \n");
scanf("%d &d", &i,&j);
getchar();
add = sum(i,j);
getchar();
printf("This is the sum of the two digits entered: %d", add);
getchar();
return 0;
}
int sum(i, j)
{
int p;
return p = i + j;
}
Edited by xXHalfSliceXx, 30 October 2009 - 04:11 PM.


Sign In
Create Account

Back to top









