Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created January 16, 2015 17:05
Show Gist options
  • Save joffilyfe/4f9775bc4b9c8745d563 to your computer and use it in GitHub Desktop.
Save joffilyfe/4f9775bc4b9c8745d563 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int j, aux;
float i;
for(i = 0; i < 2.2; i += 0.2) {
for(j = 1; j <= 3; j++) {
aux = i;
if ((i - (int)aux ) == 0.000000) {
printf("I=%0.0f J=%.0f\n", i, (float)j+i);
} else {
if (i < 2) {
printf("I=%0.1f J=%.1f\n", i, (float)j+i);
} else {
printf("I=%0.0f J=%.0f\n", i, (float)j+i);
}
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment