I want actual_password to be equivalent to cin/1000. I have specified this and the result is a randomly generated number.
For example if I type in 1000 for cin, actual_password is not equal to 1.
Code:
#include <stdio.h>
#include <string.h>
int main ()
{
char first_part_of_username[10];
char second_part_of_username[10];
char username[10];
long long int cin;
long long int password;
long long int actual_password;
char first_name[15];
char last_name[15];
printf("WELCOME TO gotransfer A JOINT PROJECT OF METROPOLITAN BANK IN PARTNERSHIP WITH GLOBE TELECOM!!!\n\n");
printf("NOTE: PRIOR REGISTRATION WITH BANK REPRESENTATIVES IS NECESSARY PRIOR TO SIGNING IN THROUGH THIS PROGRAM.\n");
printf("PLEASE ENTER THE FOLLOWING.\n");
printf("FIRST NAME:\n");
scanf("%s",first_name);
strncpy(first_part_of_username,first_name,2);
first_part_of_username[2]='\0';
printf("LAST NAME:\n");
scanf("%s",last_name);
strncpy(second_part_of_username,last_name,1);
second_part_of_username[1]='\0';
strncat(first_part_of_username,second_part_of_username,3);
printf("CUSTOMER IDENTIFIER NUMBER:");
scanf("%d",&cin);
actual_password=(cin/1000);
printf("LOGIN DETAILS\n");
printf("Username:\n");
scanf("%s",&username);
printf("Password:\n");
scanf("%d",&password);
printf("The correct password is %d",&actual_password);
if ((password,actual_password)==0 && strcmp(first_part_of_username,username)== 0)
{printf("Login successful.\n\n");}
else
{printf("Login unsuccessful. Please try again.\n\n");}
return 0;
}