Why the output of this code is | \ / | ? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 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 Respuesta
+ 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