{"id":20270,"date":"2021-09-09T19:57:41","date_gmt":"2021-09-09T14:27:41","guid":{"rendered":"https:\/\/python-programs.com\/?p=20270"},"modified":"2021-11-22T18:36:24","modified_gmt":"2021-11-22T13:06:24","slug":"python-program-to-print-even-numbers-in-given-range-using-recursion","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-even-numbers-in-given-range-using-recursion\/","title":{"rendered":"Python Program to Print Even Numbers in Given Range Using Recursion"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Divide Two Numbers Using Recursion<\/a><\/p>\n

Given the Lower and upper limits as range and the task is to print the even numbers in a given range.<\/p>\n

Recursion:<\/strong><\/p>\n

Recursion is the process by which a function calls itself directly or indirectly, and the associated function is known as a recursive function. Certain issues can be addressed fairly easily using a recursive approach. Towers of Hanoi (TOH), Inorder \/Preorder\/Postorder Tree Traversals, DFS of Graph, and other analogous issues are examples.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

 Given Lower Limit = 30\r\n Given Upper Limit = 50<\/pre>\n

Output:<\/strong><\/p>\n

The Even numbers in a given range 30 and 50 are :\r\n30 32 34 36 38 40 42 44 46 48 50<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Lower Limit = 60\r\nGiven Upper Limit = 100<\/pre>\n

Output:<\/strong><\/p>\n

The Even numbers in a given range 60 and 100 are :\r\n60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100<\/pre>\n

Program to Print Even Numbers in Given Range Using Recursion in Python<\/h2>\n

Below are the ways to print the even numbers in a given range in python:<\/p>\n