Thank you for your response.
I have made the basic model of the program based on your guidance, but again got the problem.
So the program that I started works as planned, but only for a word and not for a full sentence.
Here is the program:
Code:
#include <iostream>
#include <cstring>
using namespace std;
int i, length, JC;
string clear; / / Declaration of clear chain
int main ()
{
cout << "Enter the clear text:";
cin >> clear; // Entering the clear chain
length = clear.length(); // Set the length of chain length
cout << endl;
cout << length << endl; // Display the length of the string
cout << endl;
for (i = 0; i < length; i++)
{
JC = int (clear[i]) + int (3);
if ((JC >= 90 && JC < 97) || (JC > 122))
{
JC = JC - 26;
}
cout << char (JC);
}
cout << endl;
system ("pause");
return (0);
}
Bookmarks