VOOZH about

URL: https://www.geeksforgeeks.org/dsa/program-to-print-numbers-having-remainder-3-when-divided-by-11/

⇱ Program to print numbers having remainder 3 when divided by 11 - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Program to print numbers having remainder 3 when divided by 11

Last Updated : 20 Feb, 2024

Write a program to print all numbers from 1 to 1000 which leave a remainder of 3 when divided by 11.

Output format:

3, 14, 25, 36, 47.... 993

Approach: To solve the problem, follow the below idea:

The problem can be solved by simply using for loop and iterate from 3 up to the 1000 and increment by 11 as we are dividing by 11.

Step-by-step approach:

  • Iterate from 3 to limit, in each iteration increment by 11.
  • Print the number for each iteration.

Below is the implementation of the above approach:


Output
Numbers leaving a remainder of 3 when divided by 11 up to 1000:
3 14 25 36 47 58 69 80 91 102 113 124 135 146 157 168 179 190 201 212 223 234 245 256 267 278 289 300 311 322 333 344 355 366 377 388 39...

Time complexity: O(1)
Auxiliary Space: O(1)

Comment
Article Tags:
Article Tags: