i do not want to use strcmp() so i made it myself.
here is my code:
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int main()
{
char pass[50];
int strcomp(char pass);
cout<<" ENTER THE PASSWORD ";
gets(pass);
int m=strcomp(pass);
if(m==1)
cout<<" congrats! correct password ";
else cout<<" sorry wrong password ";
}
int strcomp(char pass)
{ int org="854856", flag=0;;
for(int i=0;i<6;i++)
{if(pass[i]==org[i])
flag=1;
else {flag=0 break;}
}
if(flag==0)
return 0;
else return 1;
}
plz tell in detail where i am wrong .