Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created January 18, 2015 16:16
Show Gist options
  • Save joffilyfe/19d31d1d5c37842a8d23 to your computer and use it in GitHub Desktop.
Save joffilyfe/19d31d1d5c37842a8d23 to your computer and use it in GitHub Desktop.
#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