Why it prints Fgh..... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why it prints Fgh.....

#include <stdio.h> int main() { printf(5+"abcdefgh"); return 0; } OUTPUT fgh

9th Apr 2020, 4:27 AM
Muralikrishnan
Muralikrishnan - avatar
1 Answer
+ 2
It is string literal. Or u can say string is the array of character. So the index of array starts with index 0 . 5+ means 5 After 5th element it evacuated and then display the output. See a b c d e f g h 0 1 2 3 4 5 6 7 0-4 is total 5th character.
9th Apr 2020, 5:42 AM
Riyaz Ali
Riyaz Ali - avatar