Hi, the main problem is getting stuck at the if part. Idk how to make the statement or the transition it from there.
All advice is appreciated and thank you in advance.
Code:
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main ()
{
char username[20];
char password[20];
char ch;
int i;
printf("\nEnter your username: ");
scanf("%s",username);
printf("*********************************\n");
printf("Enter your password:\n");
scanf("%s",password);
for(i=0;i<8;i++)
{
ch = getch();
password[i] = ch;
ch = '*' ;
printf("%c",ch);
}
password[i] = ' ';
if( strcmp ( username,"xxX_slayer69_Xxx" ) == 0 && strcmp ( password,"password" ) == 0 )
{
printf("VALID\n");
}
else
{
puts("INVALID\n");
return 0;
}
}#include <stdio.h>
#include <conio.h>
#include <string.h>
int main ()
{
char username[20];
char password[20];
char ch;
int i;
printf("\nEnter your username: ");
scanf("%s",username);
printf("*********************************\n");
printf("Enter your password:\n");
scanf("%s",password);
for(i=0;i<8;i++)
{
ch = getch();
password[i] = ch;
ch = '*' ;
printf("%c",ch);
}
password[i] = ' ';
if( strcmp ( username,"xxX_slayer69_Xxx" ) == 0 && strcmp ( password,"unliveme" ) == 0 )
{
printf("VALID\n");
}
else
{
puts("INVALID\n");
return 0;
}
}