+ 1

***pls help me with this my dudes**

Program that replaces each letter in a message with its corresponding letter in a backwards version of the English alphabet. string arr,b; gets(arr); int i; for(int j=0;j<arr.length();j++){ i=arr[j]; if(i!=' ') cout<<b[90-i+65]; else return ' '; }i=0; return 0; }

7th Sep 2022, 7:52 AM
RAESEN
RAESEN - avatar
1 Answer
0
arr[j] is a character. i is an integer. So it's store equalent ascii value , not character itself. b is a string... And not assigned any value yet. Then what b[ 90-i+65 ] refers to? What are you trying there? Your code in loop is "not works for your task.. " You need to revise your lesson about characters and if block and strings... return used in a function. It will stop to run further the function. So comes out of function... Hope it helps..
7th Sep 2022, 8:18 AM
Jayakrishna 🇼🇳