刚学C语言 不知道程序那里出错 求高手解答
#include"stdio.h"
#include"stdlib.h"
main()
{
int x,y,sum;
char ch=' ';
for(;ch!='n';)
{x=rand();
y=rand();
printf("%d+%d=",x,y);
scanf("%d",sum);
getchar();
if(sum==x+y)
printf("You are right!\n");
else
printf("You are wrong!\n");
printf("Do you want to more?");
ch=getchar();
printf("\n");
}
getch();
}
用的软件是WIN-TC,输入答案后输出的结果都是You are wrong!
求高手帮忙解答,看哪里出现问题了