this is my code,but when the secret number is 1851 and i put 1111 for my guess,it will say that i have placing 2 exact place and 2 wrong place...anybody can give me a solution?thx before..Code:#include <stdio.h> #include <stdlib.h> #include <time.h> int three(); main() { srand((unsigned)time(NULL)); four(); } four() { static initdone,f,s,t,r,fo,p; int first,second,third,fourth; if(initdone==0) { initdone=1; f=(rand()%10); s=(rand()%10); t=(rand()%10); fo=(rand()%10); } r=0; p=0; printf("\nI Already Set 4 Code For You..\n"); printf("%d%d%d%d\n",f,s,t,fo); printf("Please Insert Your Guess:\n"); printf("First:"); scanf("%d",&first); printf("\nSecond:"); scanf("%d",&second); printf("\nThird:"); scanf("%d",&third); printf("\nFourth:"); scanf("%d",&fourth); if(first==f) r=r+1; else if(first==s||first==t||first==fo) {p=p+1; } if(second==s) r=r+1; else if(second==f||second==t||second==fo) {p=p+1; } if(third==t) r=r+1; else if(third==f||third==s||third==fo) {p=p+1; } if(fourth==fo) r=r+1; else if(fourth==f||fourth==s||fourth==t) {p=p+1; } printf("\nYou Have place %d exact place and %d wrong place",r,p); if(r==4) {printf("\nCongratulations\n"); return 0; } else if(!(r==4)); {four(); } return 0; }