Possible Duplicate: Help with C puzzle
This morning i had a job interview and they gave me this problem:
You should change one character to print "*" 42 times. You can replace, add or remove ONLY one character.
Still i cant figured it, i've tried over and over again.
#include <stdio.h>
main(){
int i,n = 42;
for(i = 0; i < n; i--){
printf("*");
}
}
#include <stdio.h>
main(){
int i,n = 42;
for(i = 0; -i < n; i--){ //added a minus here
printf("*");
}
}
But to be honest, I think that this is a silly interview question.