EXACT OUTPUT IS OPTIONAL FOR PYTHON AND JAVASCRIPT
WAP to read a number and print all numbers from 1 to that number [box title=”” bg_color=”#dbdbdb” align=”left”]input: enter a number: 5 output: 1 2 3 4 5 [/box]
WAP to read number and print all even numbers from 1 to that number [box title=”” bg_color=”#dbdbdb” align=”left”]input: enter a number: 5 output: 2 4 [/box]
WAP to print all number from 1 to 10 by using while, for and do -while loop.
WAP to read a number and find sum of all numbers from 1 to that number [box title=”” bg_color=”#dbdbdb” align=”left”]input: enter a number: 5 output: 1 + 2 + 3 + 4 + 5 = 15 [/box]
WAP to read a number and find factorial of that number [box title=”” bg_color=”#dbdbdb” align=”left”]input: enter a number: 5 output: 1 * 2 * 3 * 4 * 5 = 120 [/box]
WAP to read a number and check if it is a prime number or not [box title=”” bg_color=”#dbdbdb” align=”left”]input: enter a number: 5 output: 5 is a prime number [/box]
WAP to print all prime number in range from 1 to 100 [box title=”” bg_color=”#dbdbdb” align=”left”]output: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 [/box]
WAP to print first 10 fibonacci number [box title=”” bg_color=”#dbdbdb” align=”left”]output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 [/box]