home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / alb_c10 / chap_05 / ch05_08.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-08  |  709 b   |  32 lines

  1. /*********************************************************************
  2. *  CH05_08.C            L'opΘrateur sΘquentiel avec for: 1er exemple   *
  3. *********************************************************************/
  4.  
  5. #include<stdio.h>
  6.  
  7. main( void)
  8. {
  9.  
  10.     int i;
  11.     long int somme;
  12.  
  13.     printf(" Donnez une valeur initiale α la somme:  ");
  14.  
  15.     for( scanf("%ld", &somme), i= 3;
  16.          i< 7;
  17.          i++
  18.        )
  19.        {
  20.         somme+= i;
  21.         printf(" i: %d\t somme= %ld\n", i, somme);
  22.        }
  23.  
  24.     printf(" Fin du programme:\t i: %d\t somme= %ld", i, somme);
  25. }
  26. /*
  27.  Donnez une valeur initiale α la somme:  10
  28.  i: 3    somme= 13
  29.  i: 4    somme= 17
  30.  i: 5    somme= 22
  31.  i: 6    somme= 28
  32.  Fin du programme:    i: 7    somme= 28                */