The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] A c program problem
@ 2018-08-22 12:01 cc
  2018-08-22 12:24 ` Donald ODona
  2018-08-22 14:21 ` Dan Cross
  0 siblings, 2 replies; 10+ messages in thread
From: cc @ 2018-08-22 12:01 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

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@163.com
|

签名由 网易邮箱大师 定制

[-- Attachment #2: Type: text/html, Size: 3456 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-08-22 15:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 12:01 [TUHS] A c program problem cc
2018-08-22 12:24 ` Donald ODona
2018-08-22 12:54   ` Mark Longridge
2018-08-22 14:21 ` Dan Cross
2018-08-22 14:26   ` cc
2018-08-22 14:29     ` cc
2018-08-22 14:32       ` Ralph Corderoy
2018-08-22 14:34         ` cc
2018-08-22 15:40       ` Toby Thain
2018-08-22 15:46         ` Caipenghui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).