#include<cmath>
#include<iostream>
using namespace std;
int x1 = 1;
int x2 = 1;
int x3 = x1 + x2;
while true{
cout << x3 << " ";
then
x1 = x2;
x2 = x3;
x3 = x1+ x2;
cout << x1 << " " << x2 << " ";
}
return 0;
so I am trying to make a program increase the ingteger by one with each run on paper it seemed more functional but now I am confused
these are the reports the debugger from Visual 2010
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(12): error C2059: syntax error : 'while'
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(12): error C2143: syntax error : missing ';' before '{'
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(12): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(22): error C2059: syntax error : 'return'
as well the only thing underlined in my code is the
while
so any and all help would be greatly appreciated thank you
#include<iostream>
using namespace std;
int x1 = 1;
int x2 = 1;
int x3 = x1 + x2;
while true{
cout << x3 << " ";
then
x1 = x2;
x2 = x3;
x3 = x1+ x2;
cout << x1 << " " << x2 << " ";
}
return 0;
so I am trying to make a program increase the ingteger by one with each run on paper it seemed more functional but now I am confused
these are the reports the debugger from Visual 2010
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(12): error C2059: syntax error : 'while'
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(12): error C2143: syntax error : missing ';' before '{'
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(12): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\hk3008\documents\visual studio 2010\projects\increment\increment\increment.cpp(22): error C2059: syntax error : 'return'
as well the only thing underlined in my code is the
while
so any and all help would be greatly appreciated thank you