0
How write for loop program?
output: 10 9 8 7 6 5 4 3 2 1
4 Respostas
+ 5
You have to use reversed function to reverse range value. Here it is
for i in reversed(range(1,11)):
print(i)
+ 1
Thanks everyone
0
using for loop in c++, we have
int i;
for(i=10 ; i>0 ; i--)
{
cout<<i<<endl;
}
using while, we have
int i=10;
while(i>0)
{
cout<<i<<endl;
i--;
}
using do-while we have
int i=10;
do
{
cout<<i<<endl;
i--;
}while(i>0);
0
oh it's python, hell I wrote that much for C++😥