+ 7

what is a output

void main() { int x; cin>>x; cout<<x; }

11th May 2018, 9:54 PM
Shubham goyal
Shubham goyal - avatar
3 Réponses
+ 5
depends on what you put on the console. cin = Console Input, so you have to input something ans it will be saved to variable x. then it will be outputted by Cout, console output. Depends on what you have put tho
11th May 2018, 10:07 PM
Paul
+ 2
You'd probably get a compilation error since void isn't a valid data type for the main() function. You also don't have return 0.
11th May 2018, 10:38 PM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
+ 2
void main() is the TurboC++ standard, which is much old today! And the output will be the same integer that has been input! (Only when the code standards are corrected)
12th May 2018, 7:56 AM
Naveen Maurya
Naveen Maurya - avatar