0

Why doesnt this work?!

Code: #include <iostream> using namespace std; int = 1 cout<<int<<endl;

29th Aug 2016, 4:49 AM
Chandler
8 Respuestas
+ 4
void main(){ int num =1; cout<<num<<endl;}
29th Aug 2016, 9:21 AM
Mustafa eldeeb
Mustafa eldeeb - avatar
+ 2
you have place a variable before equality......(such as int x=1;) then cout<<x<<endl;
29th Aug 2016, 10:16 AM
Harshit Gupta
Harshit Gupta - avatar
+ 1
try int number = 1. A variable needs a type a name. you can declear a value later.
29th Aug 2016, 6:02 AM
Miles FM
Miles FM - avatar
+ 1
put it in the main()
29th Aug 2016, 6:19 AM
Miles FM
Miles FM - avatar
0
Ima confused
29th Aug 2016, 6:15 AM
Chandler
0
print number and not int i.e. cout<<number<<endl; and try placing it inside a main()
29th Aug 2016, 7:13 PM
Harishiv Singh
Harishiv Singh - avatar
0
See the course part about variable declaration and how to use variables in statements. Now you're on the wrong way.
30th Aug 2016, 5:15 AM
Tamas Szekffy
Tamas Szekffy - avatar
- 2
Im getting a new error Code: #include <iostream> using namespace std; int number = 1 cout<<int<<endl; ^ here
29th Aug 2016, 6:15 AM
Chandler