Skip to content

Instantly share code, notes, and snippets.

@anderson-mota
Created November 13, 2012 14:36
Show Gist options
  • Save anderson-mota/4066051 to your computer and use it in GitHub Desktop.
Save anderson-mota/4066051 to your computer and use it in GitHub Desktop.
Exibir números impar de 1 a 10.
#include <stdio.h>
int main(){
int soma;
int i=1;
int total;
while(i<=10){
if(i % 2 == 1){
total = i + total;
printf("%d \t",i);
}
i = i + 1;
}
printf("Total: %d \n", total);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment