Advertisement
campos20

Untitled

May 5th, 2020
1,412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. // For. Repeticao
  6. // Autor: Alexandre Campos
  7.  
  8. int main()
  9. {
  10.     // Declaracao das variaveis
  11.     int numero;
  12.  
  13.     // Entrada de dados
  14.     printf("Digite o numero de repeticoes\n");
  15.     scanf("%d", &numero);
  16.  
  17.     // A variavel i comeca em 0, vai ate n (numero digitado),
  18.     // incrementa de um em um (i++)
  19.     for (int i=0; i<numero; i++){
  20.         // Exibicao na tela
  21.         printf("%d: PROGRAMA\n", i+1);
  22.     }
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement