When I remove "%97" then code works and prints what it expected. Like if input is "a" then it prints "f" whereas it doesn't works when that modulo 97 is present and prints whitespace.
What is reason behind this problem? How to solve it?
int main(void)
{
char *s = get_string();
for(int i = 0; i<strlen(s); i++)
printf("this is %c", (s[i]+5%97));
}
Edit : Guys after adding brackets i.e. changing my last line to "(s[i]+5)%97" program isn't working as expected. Upon entering "a" output should be "f" but it's whitespace.
Upon entering "A" I am getting "F"!! What's happening? This program is meant to convert "a" to "a+5" but it's converting "A" to "A+5". Please explain.