CodePudding user response:
The book is written and running results of the second program, \ n means a newline, if there is no putchar (' \ n ');
Press a key and then Press Enter: B
B is the first time
Press a key and then Press Enter: a
A is the second time
So if there is no putchar (' \ n '); Non-breaking two lines will be over a piece, even in a is to write the book
Press a key and then Press Enter: B
BPress a key and then press Enter: a
A
A newline is like this:
Press a key and then Press Enter: B
B here are the newline \ n mean
Press a key and then Press Enter: a
a
CodePudding user response:
reference 1st floor weixin_45837369 response: the book is written and running results of the second program, \ n means a newline, if there is no putchar (' \ n '); Press a key and then Press Enter: B B is the first time Press a key and then Press Enter: a A is the second time So if there is no putchar (' \ n '); Non-breaking two lines will be over a piece, even in a is to write the book Press a key and then Press Enter: B BPress a key and then press Enter: a A A newline is like this: Press a key and then Press Enter: B B here are the newline \ n mean Press a key and then Press Enter: a A In general is not running after a let you press any key to exit and then back to the source code interface CodePudding user response:
This textbook,,, CodePudding user response:
Take care of it, as long as you know putchar (' \ n '); Is a newline is enough, CodePudding user response:
# include Int main () { Int n=2; While (n & gt; 0) { Char ch; Ch=getchar (); Ch=ch + 32; Putchar (ch); Putchar ('/n '); N=n - 1; } return 0; } CodePudding user response:
reference 4 floor wowpH response: take care of it, as long as you know putchar (' \ n '); Is a newline is enough, This textbook is probably tell you later if you meet need to run the program twice, CodePudding user response:
Of course you also can have a try, like 5 floor CodePudding user response:
reference 5 floor wowpH reply: # include Int main () { Int n=2; While (n & gt; 0) { Char ch; Ch=getchar (); Ch=ch + 32; Putchar (ch); Putchar ('/n '); N=n - 1; } return 0; } It is with the cycle of ,,,, CodePudding user response:
refer to 6th floor weixin_45837369 response: Quote: refer to 4th floor wowpH response: Take care of it, as long as you know putchar (' \ n '); Is a newline is enough, Books about the meaning of this is to tell you later if you meet need to run the program twice, Uh huh? (word gossip to gather together enough,,) CodePudding user response:
About running two consecutive times, say a point has nothing to do with the program (C language) : 1, this have to multitask operating system Shouldn't such as DOS, Windows, Windows command prompt can also 2, the load module and exe files about The realization of the 3, sometimes it is not allowed to run multiple times Should have detection module in the program, if have been detected running, just ourselves out 4, how can run multiple Windows command prompt Direct input exe file name, enter, this is a Again, is the second time, PS: in the IDE may not be able to run repeatedly may also can, CodePudding user response:
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html