![]() |
VOOZH | about |
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:
Below is the implementation of the above approach:
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)