Created
November 13, 2012 14:36
-
-
Save anderson-mota/4066051 to your computer and use it in GitHub Desktop.
Exibir números impar de 1 a 10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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