To end the cout do i need to have return 0; and {} | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

To end the cout do i need to have return 0; and {}

11th Mar 2018, 2:00 PM
william rivera
william rivera - avatar
5 Answers
+ 5
If you are using int main() or other main functions at the end of the program you must use return 0; I prefer void main () it doesn't need return 0. To the end of the cout need not use return 0 but use ;'s
11th Mar 2018, 2:59 PM
Thomas Kurian
Thomas Kurian - avatar
+ 3
in c++ every statement should end with a semicolon cout is just an predefined output function which is a part of the statement
11th Mar 2018, 2:28 PM
gnaneswari kolathuru
gnaneswari kolathuru - avatar
+ 3
To end cout you need to use semi-colan, "}" is for the whole function.
13th Mar 2018, 6:22 AM
blue
blue - avatar
0
to end cout, you need semi-colon ( ; ) return 0 and {} are for the entire program eg cout << "Hi" ;
11th Mar 2018, 2:03 PM
‎ ‏‏‎Anonymous Guy
0
thank you
11th Mar 2018, 6:15 PM
william rivera
william rivera - avatar