Order of inputs and outputs. What goes where? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Order of inputs and outputs. What goes where?

is cout first or cin or int etc. or is there no difference. also what is the difference between ++x and x++ difference

26th Oct 2016, 9:29 PM
AKB “Sakazuki” 14
AKB “Sakazuki” 14 - avatar
1 Answer
+ 1
There is no such thing as an "order". You use what you need, when you need it. If you need to declare a new variable, you will use data types such as int, char, string, bool etc. If you need to print something to the console, you will use std::cout, and if you need to take input from the user, you will use std::cin. ++x is a pre-increment. The value of x is incremented by one before it is used. x++ is a post-increment. The value of x is incremented by one after it is used.
26th Oct 2016, 11:19 PM
Cohen Creber
Cohen Creber - avatar