Created
January 18, 2015 16:16
-
-
Save joffilyfe/19d31d1d5c37842a8d23 to your computer and use it in GitHub Desktop.
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(void) { | |
int i; | |
float sum; | |
i = sum = 0; | |
for (i = 1; i <= 100; i++) { | |
sum += (float)1/i; | |
} | |
printf("%.2f\n", sum); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment