Txerrinko

Bucle For con Contadores

Jul 26th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.  
  7.   int c ,s ,n ;
  8.   c=0;
  9.   s=0;
  10.  
  11. for ( n= 90 ; n>= 47 ; n--)
  12.  
  13. {
  14.     s=s+n;
  15.     c=c+1;
  16. }
  17. printf("\n %d %d",s,c);  
  18.  
  19.  
  20.  
  21.  
  22.   system("PAUSE"); 
  23.   return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment