Is something wrong on the line 8?

Is something wrong on the line 8?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  #include <iostream>
using namespace std;
int main()

{
 int n,a,m,nr=0;
 cout<<"n=";cin>>n;
 for (a=9;a>=;a--)
 {
  m=n;
  while(m!=0&&m%10!=a)m=m/10;
  if(m!=0)nr=nr*nr*10+m%10;

 }

 cout<<endl<<"nr="<<nr;
 return 0;
}
 
Yes. What is a supposed be greater than or equal to?
closed account (48T7M4Gy)
Obviously, for (a=9;a>=n;a--)
the spacebar can be your friend.
Topic archived. No new replies allowed.