Question: Please solve in C program this is what i have so far #include #include int main(void){ } char input[5] int i, all_digits; do{ printf(Type the
Please solve in C program
this is what i have so far
#include
int main(void){ } char input[5] int i, all_digits;
do{ printf("Type the last four digits of your card number"); scanf("%s",input);
all_digits=1; for (I=0; input[1]; i++) { if (!isdigit(input[I])) { all_digits = 0; break; } } if (all_digits){ if (input[0] == '1' && input [1] == '2' && input[3] == '5'){ printf("Authenticated Successfully! "); break; } else { printf("The Four Digits Do Not Match! Do You Want to Try Again? (y/n)"); char response; if (response != 'y'){ printf("Authentication Failed! "); break; } } } else { printf("Invalid Input! Do You Want to Try Again? (y/n)"); char response; scanf("%c", &response); if (response != "y"){ printf("Authentication Unsuccessful! "); break; } } while (1); return 0;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
