#include <iostream>
usingnamespace std;
int a,b,c,d=5,e,f,g,h,i;
int main(){
cout<<"please enter a number two count down from:";
cin>>a;
cout<<"\n\nplease enter a number to stop on \notherwise type 0:";
cin>>b;
cout<<"\n\nplease enter a number to skip from:";
cin>>e;
cout<<"\n\nplease enter a number to skip to:";
cin>>f;
cout<<"\n=================================-\n";
cout<<'\n\n';
g=e-f;
h=g;
int arra[g];
do{
arra[g]=e;
--e;--g;
}while (g>0);
g=0;
for (;0<a;--a){
do{ if (arra[h]==a) continue ;
--h;
}while(h!=0);
--h;
cout<<a<<',';
c=0;
if (a==b){c=5;
cout<<" Count down terminated\n\n\n";
break;}
}
if (c!=d)cout<<"\n BANG\n\n";
system ("pause");}
and i can't find were the bugg is its intended to
1st ask a number to count down from
2nd ask a number to stop at (if any)
3rd ask numbers to skip from and too
but i keep on getting an "arra size unknown" message can anyone help PLEASE
this is the most complex code i have writen so far.
It is not necessary to change the quotes in line 28...
The use of double quotes is for strings cout << "This is a string"; //Necessary double quotes
The use of single quotes is for chars cout << 'c'; //Not necessary double, single is fine
If you just want to use a char you can use single quotes. But to use multiple characters you have to use double quotes.
That's why line 14 is wrong, it has two characters (2 times the '\n') but line 28 is correct (only one char ',')