0 0 votes #include<stdio.h> int main() { int i=0; for(printf(" one\n "); i < 3 && printf(" "); i++) { printf("Hi!\n"); } return 0; } Others + – shiva0 2.0k views answer comment Share Follow Print See all 7 Comments 7 7 Comments reply Naveen Kumar 3 commented Jul 14, 2018 reply Follow flag one Hi! Hi! Hi! 0 0 replyShare gauravkc commented Jul 14, 2018 reply Follow flag (space)one (space)(space)Hi (space)Hi (space)Hi 0 0 replyShare shiva0 commented Jul 14, 2018 reply Follow flag how? can you explain.. 0 0 replyShare gauravkc commented Jul 14, 2018 reply Follow flag A for loop is defined as for(initialization ; Condition ; Increment/Decrement) { statements } Initialization is done only once. Then condition is checked. And then, statement execution -> Increment / Decrement -> Condition check is carried out in a loop fashion. Try it now :) Also, if you are confused how i < 3 && printf(" ") works. printf function returns the number of characters it printed successfully. Note that you are printing one character (space) here. 0 0 replyShare Mayankprakash commented Jul 14, 2018 reply Follow flag @gaurav Nice explained. My doubt is in intialization part of loop -> printf should return 3 as it contains 'one' so variable 'I' should be initialised to 3 than 0. Please suggest Thanks 0 0 replyShare gauravkc commented Jul 14, 2018 reply Follow flag printf(" one\n ") will return 6. As there are 6 characters between double quotes. Characters include not only alphabets but also space, newline, punctuation marks, etc. Note that \n is considered as one char as it represents a new line. Also, there is space before and after the string. The value returned by printf is not assigned to i. Hence i will still be 0 (as initialized before entering loop) 0 0 replyShare shiva0 commented Jul 14, 2018 reply Follow flag @gauravkc Thank you! Nice explanation.!!!! 0 0 replyShare Please log in or register to add a comment.