The program must print from 111 to 2 with the values separated by a space.
Python
for ctr in range(111, 1, -1):
print(ctr, end = " ")
Java
import java.util.*;
public class Hello {
public static void main(String[] args) {
for (int ctr = 111; ctr >= 2; ctr--) {
System.out.print(ctr + " ");
}
}
}
C
#include <stdlib.h>
#include <stdio.h>
int main()
{
int ctr;
for(ctr = 111; ctr >= 2; ctr--)
{
printf("%d ", ctr);
}
return 0;
}
C++
#include <iostream>
using namespace std;
int main()
{
for(int ctr = 111; ctr >= 2; ctr--)
{
cout << ctr << " ";
}
return 0;
}
Leave a Reply