Answer to Question #38216 in C++ for mae salen

Question #38216
A C++ that will aceept 8 digit PIN number with dash every after 2 digits.The program must remove all dashes.
1
Expert's answer
2014-01-09T09:41:01-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS