IN C programming
4.15 LAB: Password modifier
Many user-created passwords are simple and easy to guess. Write a program that takes a simple password and makes it stronger by replacing characters using the key below, and by appending "q*s" to the end of the input string. You may assume that the string does not contain spaces and will always contain less than 50 characters.
Ex: If the input is:
mypassword
the output is:
[email protected]*s
C PROGRAMMING
#include <stdio.h> int main() { char password[100]; scanf("%s", password); int i = 0; while (password[i]) { char ch = password[i]; if (password[i] == 'i') { ch = '!'; } else if (password[i] == 'a') { ch = '@'; } else if (password[i] == 'm') { ch = 'M'; } else if (password[i] == 'B') { ch = '8'; } else if (password[i] == 'o') { ch = '.'; } printf("%c", ch); i++; } printf("q*s\n"); return 0; }
Get Answers For Free
Most questions answered within 1 hours.