Advertisement
Schknheit

Untitled

May 6th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5. int r,n,a1,an,cont,soma;
  6.  
  7. printf("Entre com a razao, quantidade de termos e o primeiro elemento\n");
  8. scanf("%d%d%d",&r,&n,&a1);
  9.  
  10. printf("%d\n", a1);
  11.  
  12. soma = a1;
  13.  
  14. for(cont = 0; cont < n; cont++){
  15. soma = soma + r;
  16. printf("%d\n",soma);
  17. }
  18. }
  19.  
  20.  
  21. razao,n,a1,cont,soma: inteiro
  22.  
  23. (inicializando, r, n, a1)
  24.  
  25. mostrar a1
  26.  
  27. soma = a1
  28.  
  29. para cont = 0, cont < n, cont++
  30. inicio para
  31. soma = soma + razao
  32. mostrar soma
  33. fim para
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement