Advertisement
campos20

Untitled

May 10th, 2020
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. // Exibe n numeros pares
  5. // Autor: Alexandre Campos
  6.  
  7. int main()
  8. {
  9.     // Declaracao
  10.     int n;
  11.     int par;
  12.  
  13.     // Entrada de dados
  14.     printf("Digite o numero de numeros pares a serem exibidos\n");
  15.     scanf("%d", &n);
  16.  
  17.     // For
  18.     for (int i=0; i<n; i++){
  19.         par = 2 * i;
  20.  
  21.         printf("%d\n", par);
  22.     }
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement