0
c program for stm32 nucleo true studio
Program to match passcode within array 10 digits Output is print Wrong password with when not match And Right password when passcode is wrire
1 Odpowiedź
0
int []userPass = new int [10];
int [] truePass = {1,2,3,4,5,6,7,8,9,0};
bool match = true;
for (int i=0; i<pass.length;i++)
{
if(userPass[i] != truePass[i])
{
match = false;
break;
}
}
if (match)
{
console.Write("Right password");
}
else
{
console.Write("Wrong password");
}