Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Created April 21, 2015 23:31
Show Gist options
  • Save rogerioagjr/f75aeefc3897efbf1921 to your computer and use it in GitHub Desktop.
Save rogerioagjr/f75aeefc3897efbf1921 to your computer and use it in GitHub Desktop.
Até 10
#include <cstdio>
int main(){
int n=1; // declaro a variável n começando com o valor 1
while(n<=10){ // enquanto n for menor ou igual a 10
printf("%d ", n); // imprima o valor de n e um espaço
n++; // e adicione 1 ao seu valor
}
printf("\n"); // imprima a quebra de linha
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment