+ 3

Why the output of this code is | \ / | ?

char arr[4]={'|','\\','/'}; for(int i=0;i<4;i++) cout <<arr[i%3];

16th Jul 2020, 9:22 AM
The future is now thanks to science
The future is now thanks to science - avatar
1 Réponse
+ 2
Samsil Arefeen because '|' when printed gives | '\\' when printed gives \ because here single \ is used for escape sequence '/' when printed gives / Combined gives | \ / |
16th Jul 2020, 9:37 AM
Varun N
Varun N - avatar
Aujourd'hui en vedette
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes
APIs
1 Votes