Programs of While Loop QQ
Programs of While Loop QQ
Q2. Write a program to print first 10 integers and their squares using while loop.
11
24
3 9 and so on
Q5. Write a program to print first 10 natural number in reverse order using while
loop.
Q8. Write a program to print table of a number entered from the user.
Q9. Write a program to find the sum of all even numbers that falls between two
numbers (exclusive both numbers) entered from the user using while loop.
Q10. Write a program to check whether a number is prime or not using while loop.
Q11. Write a program to find the sum of the digits of a number accepted from the
user.
Q12. Write a program to find the product of the digits of a number accepted from
the user.
Q13. Write a program to reverse the number accepted from user using while loop.
Q14. Write a program to display the number names of the digits of a number
entered by user, for example if the number is 231 then output should be Two Three
One
Q15. Write a program to print the Fibonacci series till n terms (Accept n from user)
using while loop.
Q16. Write a program to print the factorial of a number accepted from user.
Q18. Write a program to enter the numbers till the user wants and at the end it
should display the sum of all the numbers entered.
Q19. Write a program to enter the numbers till the user enter ZERO and at the end
it should display the count of positive and negative numbers entered.
Q20. Write a program to find the HCF of two numbers entered from the user.
Q22. Write a program to accept 10 numbers from the user and display it’s average
Q23. Write a program to accept 10 numbers from the user and display the largest
& smallest number number.
Q24. Write a program to display sum of odd numbers and even numbers separately
that fall between two numbers accepted from the user.(including both numbers)
using while loop.
Q25. Write a program to display all the numbers which are divisible by 13 but not
by 3 between 100 and 500.(exclusive both numbers)
Q31. Write a Program to print all the characters in the string ‘PYTHON’ using
while loop.
Q32. Write a program to print only odd numbers from the given list using while
loop. L = [23, 45, 32, 25, 46, 33, 71, 90]
Q33. Write a program to print all the factors of a number using for loop.
NOTE : The Questions which are highlighted with red colour those questions we
will do later because those questions are from LIST and DICTIONARY. You
don’t have to do those question now.