Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created January 19, 2015 00:08
Show Gist options
  • Save joffilyfe/c44c4f6b64f3e32fe5b7 to your computer and use it in GitHub Desktop.
Save joffilyfe/c44c4f6b64f3e32fe5b7 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) {
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