Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. int total (int n) {
  2.     int i, subtotal;
  3.  
  4.     for (i = 0; i < n; i++)
  5.         subtotal += i;
  6.  
  7.     return subtotal;
  8. }
  9.  
  10. main () {
  11.     int total = 0;
  12.  
  13.     scanf ('%d", &n);
  14.  
  15.     for (i = 0; i < n ; i++)
  16.         tot += total (i);
  17. }
Add Comment
Please, Sign In to add comment