[TUHS] A c program problem

cc caipenghui_c at 163.com
Wed Aug 22 22:01:42 AEST 2018


Hello everyone

I had a problem compiling a piece of c code from the book. The result of running the book is 5050, but the compiler is 100. I don't know which is right, please help me to see which is wrong. Thank you very much!

#include <stdio.h>

int main(void)
{
       int i, sum = 0;
       i = 1;
       while ( i <= 100) {
       sum = sum + 1;
       i++;
       }
       printf("%d\n", sum)
       return 0;
}




| |
cc
|
|
邮箱:caipenghui_c at 163.com
|

签名由 网易邮箱大师 定制
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20180822/f43526e0/attachment.html>


More information about the TUHS mailing list