Skip to content

Instantly share code, notes, and snippets.

@krha
Forked from theonewolf/odd.c
Created February 23, 2012 22:41
Show Gist options
  • Save krha/1895489 to your computer and use it in GitHub Desktop.
Save krha/1895489 to your computer and use it in GitHub Desktop.
odd static test in C
#include <stdio.h>
int good(int i)
{
i++;
return i;
}
int not_good(int i)
{
for (; i < 1000000;i++)
return i;
return 0;
}
int main()
{
int index1 = 0, index2 = 0;
while (1){
index1 = good(index1);
index2 = not_good(index2);
fprintf(stdout, "%d -- %d\n", index1, index2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment