DEV Community

He Codes IT
He Codes IT

Posted on

C++ Programming Solutions — Encrypt String

Today we will give you the C++ Programming Solution of Encrypting a String. We are going to encrypt a simple String in C++. The Coding Problem and its Solution are below.

Question
Kathy is a scientist who is developing a machine that creates 5-character long string code. She prefers to encrypt the strings rather than save them as they are. She’s requested you to create software that would accept a 5-character string as input and encrypt it in the format she’s provided.
You must look for the letters in the odd locations of the string and, if they are vowels, you must replace them with _ (underscore).

Example
“hecod” should be “h_c_d”.
“progr” should be “progr”. because odd locations are not vowels.

To Get The Answer Visit https://hecodesit.com/c-programming-solutions-encrypt-string/

Discussion (0)