Hi . I am coding the following program
i will give the string my self and one is already given.
given string = {a,b,c,d,3,f,g,h,i,6,j,k,l,m,9,n,o,p,q,2,r,s,t,u,v,w,x,y,z }, you are required to process an
input string possibly less than 80 characters long, and an input +ive integer to encrypt the
message: for example:
Entered Message: love you all.
+ive Yolo Integer: 3
Yolo Encryption: n2yh b2x dnn
I want to print the next 3rd alphabet of my input string after comparison with above string
the third alphabet after l is n
the third alphabet after o is 2 and all that ... My code is following but it is printing garbage . let me know and correct it please .
#include<iostream>
#include<string>
using namespace std;
int main(){
char str1[]={'a','b','c','d','3','f','g','h','i','6','j','k','l','m','9','n','o','p','q','2','r','s','t','u','v','w','x','y','z' };
char str2[80];
int i,n=2,result;
cout<<"Enter any string"<<endl;
cin>>str2;
cout << "String you enter is : " << str2 << endl;
for(i=0;i<=80;i++){
if (strcmp( str1, str2)==0)
str2[i+n];
if(result==0){
str2[i+n];
cout<<str1[i+n];
}
system("pause");
}