🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4758

Re: HELP!! Beginner's question...

#4758
From: Dr. R. Frank
Date: Fri, 02 Feb 1996 07:32
27 lines
1154 bytes
Ramon Mariano Jr <rmariano@u.washington.edu> wrote:
>Hello everybody!
>
>I'm a beginning C-programmer ...
>                  
>int main(void)
>{
>   int i,         /* integer */
>       n,         /* power to raise integer */
>       i_total,   /* integer's total value*/
>       count;     /* keeps track of number of loops run */

You must declare: int i, n, count;
  but:  long i_total;
>
>   /* asks for an integer and stores it in 'i' */
  .
  .
  .......
>    for (count = 1;  count <= n;  count = count + 1){
>        i_total = i_total * i;
 you can write in C:
     for (count = 1; count <= n; count++)
         i_total *= i; 

I hope, that this will help you!
Robert
Technical Details
Message-ID: <4esi6d$m3g@news.bmw.de>
Path: arc1-ca.pugleaf.net!news.bmw.de!usenet!frankro
References: <Pine.OSF.3.91l.960131005708.7552A-100000@saul3.u.washington.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Message-ID: <4esi6d$m3g@news.bmw.de>
From: frankro@bmw.de (Dr. R. Frank)
Path: arc1-ca.pugleaf.net!news.bmw.de!usenet!frankro
Subject: Re: HELP!! Beginner's question...
Date: Fri, 02 Feb 1996 07:32:13 +0000
References: <Pine.OSF.3.91l.960131005708.7552A-100000@saul3.u.washington.edu>
X-Gateway: ZCONNECT XX ius.gun.de [UNIX/Connect v0.73]
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit