I have 2 questions to ask the experts here,
1 I'm a beginner in C. Today I wrote a program for an exam. When debugging it, there are no syntax errors anymore,
but it still never outputs the correct value.
Could you please point it out for me—where exactly is the mistake?
main()
{int a;
int i=0;
long sum=0;
for (;i<3;i++);
{ scanf("%d",&a);
sum+=a;
}
printf("%d\n",sum);
}
(Input an array and output the sum of the digits)
2 I'm using the XP operating system. When I use TC from the command prompt, why is it that when I switch to drive D (I installed TC on drive D), I can open it, but when executing a program it always can't open the header files, while if I install TC on drive C and run it, this problem does not occur? What's going on?
Thanks for your advice!
1 I'm a beginner in C. Today I wrote a program for an exam. When debugging it, there are no syntax errors anymore,
but it still never outputs the correct value.
Could you please point it out for me—where exactly is the mistake?
main()
{int a;
int i=0;
long sum=0;
for (;i<3;i++);
{ scanf("%d",&a);
sum+=a;
}
printf("%d\n",sum);
}
(Input an array and output the sum of the digits)
2 I'm using the XP operating system. When I use TC from the command prompt, why is it that when I switch to drive D (I installed TC on drive D), I can open it, but when executing a program it always can't open the header files, while if I install TC on drive C and run it, this problem does not occur? What's going on?
Thanks for your advice!

