Program to print all three digit numbers in ascending order Last Updated : 10 Feb, 2024 Comments Improve Suggest changes Like Article Like Report Write a program to print all the three-digit numbers in ascending order. Output Format: 100 101 102...till 999 Approach: Using for Loop to print all the three Digit Numbers: Use for loop to iterate from the smallest three-digit number, that is 100 till we reach the largest three-digit number, that is 999 and, in every iteration, print the number. After reaching 999, we will have all the three-digit numbers in ascending order. Step-by-step algorithm: Initialize a counter to the smallest 3-digit number i.e. 100.Run a for loop till the greatest 3-digit number i.e. 999.For each iteration print the numberBelow is the implementation of the above approach: C++ #include <iostream> using namespace std; // Function to print all the three-digit numbers in // ascending order void print3DigitNums() { for (int count = 100; count <= 999; count++) { cout << count << endl; } } // Driver code int main() { cout << "All three digit numbers in ascending order: \n"; print3DigitNums(); } Java public class GFG { // Function to print all the three-digit numbers in ascending order public static void print3DigitNums() { for (int count = 100; count <= 999; count++) { System.out.println(count); } } // Driver code public static void main(String[] args) { System.out.println("All three-digit numbers in ascending order: "); print3DigitNums(); } } // This code is contributed by Yash Agarwal(yashagarwal2852002) Python3 # Function to print all the three-digit numbers in # ascending order def print_3_digit_nums(): for count in range(100, 1000): print(count) # Driver code if __name__ == "__main__": print("All three digit numbers in ascending order:") print_3_digit_nums() C# using System; class GFG { // Function to print all the three-digit numbers in ascending order public static void print3DigitNums() { for (int count = 100; count <= 999; count++) { Console.WriteLine(count); } } // Driver code public static void Main(string[] args) { Console.WriteLine("All three-digit numbers in ascending order: "); print3DigitNums(); } } JavaScript // Function to print all the three-digit // numbers in ascending order function print3DigitNums() { for (let count = 100; count <= 999; count++) { console.log(count); } } // Driver code console.log("All three digit numbers in ascending order: "); print3DigitNums(); OutputAll three digit numbers in ascending order: 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138...Time Complexity: O(1000) = O(1)Auxiliary Space: O(1) Comment More infoAdvertise with us Next Article Program to print all three digit numbers in ascending order V vaibhav_gfg Follow Improve Article Tags : DSA Similar Reads Program to print ASCII Value of all digits of a given number Given an integer N, the task is to print the ASCII value of all digits of N. Examples: Input: N = 8Output: 8 (56)Explanation:ASCII value of 8 is 56 Input: N = 240Output:2 (50)4 (52)0 (48) Approach: Using the ASCII table shown below, the ASCII value of all the digits of N can be printed: DigitASCII V 5 min read Print number in ascending order which contains 1, 2 and 3 in their digits. Given an array of numbers, the task is to print those numbers in ascending order separated by commas that have 1, 2, and 3 in their digits. If no number containing digits 1, 2, and 3 is present then print -1. Examples: Input : numbers[] = {123, 1232, 456, 234, 32145}Output : 123, 1232, 32145 Input : 6 min read Program that receives a number and prints it out in large size Write a program that receives a number n as input and prints it in large size on a same line as shown below in the image. Examples :Â Input : n = 0194Output : Input : n = 0123456789Output : We use two-dimensional character array to store those hash strings for each digit. The for loop reads each dig 15+ min read Print all numbers in given range having digits in strictly increasing order Given two positive integers L and R, the task is to print the numbers in the range [L, R] which have their digits in strictly increasing order. Examples: Input: L = 10, R = 15 Output: 12 13 14 15 Explanation: In the range [10, 15], only the numbers {12, 13, 14, 15} have their digits in strictly incr 5 min read Print all numbers up to N in words in lexicographical order Given an integer N, the task is to print all numbers from 1 to N (0 < N < 100000) in words in lexicographical order. Examples : Input: N = 11Output: eight, eleven, five, four, nine, one, seven, six, three, twoExplanation: The numbers from 1 to N is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. Their resp 8 min read Like