+ 7

Why is this showing error while executing (i am annoyed with this code , does it have any error)????

#include <stdio.h> #include<string.h> int main() {   int n; n=0;     printf("Hello World");     printf("Please enter a string:");     char ch[20];         scanf("%s",ch);     n=strlen(ch);     for(int j=n-1;j>=0;j--)     printf("%c",ch[j]);     return 0; }

29th Apr 2020, 9:01 AM
Raj Kalash Tiwari
Raj Kalash Tiwari - avatar
6 Answers
29th Apr 2020, 9:05 AM
Raj Kalash Tiwari
Raj Kalash Tiwari - avatar
+ 3
~ swim ~ wrote "(most likely as dots '.')"... and at least in dark mode "mononokaĂź" are magenta hilighted, so there are very easy to find ;)
29th Apr 2020, 10:10 AM
visph
visph - avatar
+ 2
It doesn't, but if you look at the code you linked to it contains weird whitespace characters. It works fine when you remove those.
29th Apr 2020, 9:27 AM
Damyian G
Damyian G - avatar
+ 1
~ swim ~ yes, we are talking of the same thing ;) There's nothing I suggested to "set the dark mode and set this or rhat font"... I would have only suggested that the hilight color info could be relevant to add (and that's those special chars thanks to that wich are "very easy to find" but not to turn or set this or that ^^) I've probably bad expressed myself, or missunderstood your last post ;P
29th Apr 2020, 10:20 AM
visph
visph - avatar