Francelmo

Do-While

Mar 2nd, 2020
119
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. //Slide 13.
  3. int main(){
  4.     int a, b, soma = 0, cont;
  5.     scanf("%d %d", &a, &b);
  6.     do{
  7.         cont = a + 1;
  8.         soma = cont + soma;
  9.         a = a + 1;
  10.     }while(a < (b-1));
  11.     printf("%d", soma);
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment