0

include

int main(void) { k = get_int("Enter a number: ") char str[20]; printf("Enter message"); gets(c); for (i = 0; i < strlen(str); i ++) { if (islower(str[i]) { str[i]=str[i]-97; str[i]=str[i]+((str[i]+k)%26); str[i]=str[i]+97; } if(isupper(str[i]) {str[i]=str[i]-65; str[i]=str[i]+((str[i]+k)%26); str[i]=str[i]+65; } } printf("the final message is"); puts(str); return 0; }

2
  • 2
    Please edit the question and properly format the code. After you choose edit, select the code and click the {} in the format bar. May 5 '20 at 16:05
  • Also, please explain what problems you are seeing, what input you used, what results you are getting, whether it compiled, or what compiler errors were generated, etc. This is known as a naked code drop - a posting of code with little or no explanation and simply asking someone else to fix the problem. This is against forum rules.
    – Cliff B
    May 5 '20 at 17:27

You must log in to answer this question.

Browse other questions tagged .