66 840
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #5801 in C++ for Jade Devin

Question #5801
The category must be c... but i tried putting it into c yet it doesn't work..... well here is the question... tnx in advance

Why do you need to put \n after an specifier in doing loop commands?

like this:

for(d=15;d<20;d++){
printf("%d\n", d);
}

i tried removing \n yet it doesn't work, why is it so?
Expert's answer
#include <stdlib.h>




int main() {

int d;

for (d = 15; d < 20; d++) {

printf("%d
", d);

}

return 0;

}




//we should use '
' to go to new line

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions