Code:#include <stdio.h>
int main(void) {
int i = 5;
/* Add a line of code here to make the printf() below output 5 */
i = 8;
printf("%d\n", i);
return 0;
}
Printable View
Code:#include <stdio.h>
int main(void) {
int i = 5;
/* Add a line of code here to make the printf() below output 5 */
i = 8;
printf("%d\n", i);
return 0;
}
Umm:
Code:#include <stdio.h>
int main(void) {
int i = 5;
#define printf printf("5\n");
i = 8;
printf("%d\n", i);
return 0;
}
anyone come up with anything different..?? :cool:
Same idea:
or with two lines (under the assumption your x86)Code:#include <stdio.h>
int main(void)
{
int i = 5;
#define jab \
i = 8;
printf("%d\n", i);
return(0);
}
Code:#include <stdio.h>
int main(void)
{
int i = 5;
__asm add ebp,4
i = 8;
__asm sub ebp,4
printf("%d\n", i);
return(0);
}
used more than one line..!!! :P
I know its kind of cheesey...Code:#include <stdio.h>
int main(void)
{
int i = 5;
if (i == 0)
i = 8;
printf("%d\n", i);
return 0;
}
Code:#include <stdio.h>
int main(void) {
int i = 5;
while(false)
i = 8;
printf("%d\n", i);
return 0;
}
Some more x86 asm.
Code:#include <stdio.h>
int main(void) {
int i = 5;
a: __asm jmp a+12
i = 8;
printf("%d\n", i);
return 0;
}
Bah...why not?Code:#include <stdio.h>
int main(void)
{
int i = 5;
return printf("5"),0;
i = 8;
printf("%d\n", i);
return 0;
}
Code:#include <stdio.h>
int main(void) {
int i = 5;
/* Add a line of code here to make the printf() below output 5 meow!
i = 8; */
printf("%d\n", i);
return 0;
}
Does that mean "i = 8;" is 12 bytes long in the .exe?Quote:
Originally Posted by Quantum1024
no,
is assumed to be 12 bytes long i = 8; AND the jmpCode:a: __asm jmp a+12
i = 8;