Advertisement
Avdluna

Untitled

Sep 1st, 2015
129
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. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int a,b,soma=0,i;
  7.  
  8.         scanf("%d %d", &a, &b);
  9.  
  10.  
  11.     for(i = a ; i < b + 1 ; i++){
  12.  
  13.         soma += i;
  14.  
  15.     }
  16.  
  17.         printf("%d\n", soma);
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement