159k views
3 votes
Write a for loop that uses the print function to display the integers from 10 down to 1 (including 10 & 1) in decreasing order

User Chkimes
by
4.1k points

1 Answer

5 votes

Answer:

ill do this in Java, C# and C++

Java:

for(int i = 10; i >=1; i--)

{

System.out.println(i);

}

C#:

for(int i = 10; i >=1; i--)

{

Console.WriteLine(i);

}

C++:

for(int i = 10; i >=1; i--)

{

cout << i << endl;

}

User Silka
by
4.0k points