Advertisement
campos20

Untitled

May 10th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. // Contador de 0 ate o numero digitado
  5. // Autor: Alexandre Campos
  6.  
  7. int main()
  8. {
  9. // Declaracao
  10. int n, opcao;
  11.  
  12. do
  13. {
  14. // Entrada de dados
  15. printf("Digite o numero\n");
  16. scanf("%d", &n);
  17.  
  18. // Exibicao
  19. for (int i=0; i<=n; i++)
  20. {
  21. printf("Contador: %d\n", i);
  22. }
  23.  
  24. printf("\nDigite:\n");
  25. printf("1: Continuar\n");
  26. printf("2: Parar\n");
  27. scanf("%d", &opcao);
  28. }
  29. while (opcao == 1);
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement