Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/ckit/regression/valid-programs/fact1.c
ViewVC logotype

View of /sml/trunk/ckit/regression/valid-programs/fact1.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (download) (as text) (annotate)
Wed Apr 5 18:34:51 2000 UTC (19 years, 6 months ago) by dbm
File size: 331 byte(s)
Initial revision
void printf();

main (){
  int i,a;

  for (i=1,a=1; i<=6;i++)
    {
      a = a * i;
    }

  printf ("fact 6 = %d\n",a);

  i = 1;
  a = 1;

  while (i<=7)
    {
      a = a * i++;
    }

  printf ("fact 7 = %d\n",a);


  i = 1;
  a = 1;

  do
    {
      a = a * i++;
    } while (i<=8);

  printf ("fact 8 = %d\n",a);
}
      

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0