Guest User

Untitled

a guest
Nov 27th, 2020
20
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int sum(int x) {return x * (x + 1) / 2;}
  4.  
  5. int main() {
  6.   for (int i = 10; i <= 20; i++) {
  7.     printf("i=%d sum(i)=%d\n", i, sum(i));
  8.   }
  9. }
  10.  
RAW Paste Data