Question #38216

A C++ that will aceept 8 digit PIN number with dash every after 2 digits.The program must remove all dashes.

Expert's answer

#include #include int main() /* main function*/
{
char pin[11]; //size of pin-number with dashes
printf("Enter pin-number xx-xx-xx-xx: ");
scanf("%s",pin); //read pin-number from user
printf("pin-number without dash: ");
for(int i=0; i<=10; i++)
{
if ( pin[i] == '-')
continue;
printf("%c",pin[i]); /*output numbers on display*/
/*its also can be written in array*/

}
printf("
");
system("pause");
return 0;
}
LATEST TUTORIALS
APPROVED BY CLIENTS