Question: A website requires that passwords only contain numbers. For each character in passPhrase that is not a number, replace the character with ' 0 '
A website requires that passwords only contain numbers. For each character in passPhrase that is not a number, replace the character with the number zero
Ex: If the input is then the output is:
Valid password:
Note: isdigit returns true if a character is a digit, and false otherwise. Ex: isdigit returns true. isdigita returns false #include
#include
using namespace std;
int main
string passPhrase;
unsigned int i;
getlinecin passPhrase;
Your code goes here
cout "Valid password: passPhrase endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
