Advertisement
FoxTuGa

NumXCalY - <Old>

May 8th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int num;
  4. int x;
  5. int total;
  6.  
  7. int main()
  8. {
  9.     printf("\nIntroduza um numero: ");
  10.     fflush(stdin);
  11.     scanf("%d", &num);
  12.  
  13.     for(x=1;x<=20;x++)
  14.         total+=x*num;
  15.  
  16.     printf("\n\t Total: %d\n\n", total);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement