wiley_pastebin

Question 18

Apr 11th, 2019
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2. int function(int x){
  3.     int result = 0;
  4.     for(int i=1; i<x; i++){
  5.         result = result + (i*x);
  6.     }
  7.     return result;
  8. }
  9. int main(void) {
  10.     printf("%d\n",function(3));
  11.     return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment