AssIgnment 3(Loops)
AssIgnment 3(Loops)
Q.2. Write a program that will print the numbers from 1 to n, where the value of n will be
inputted by the user.
Q.3. Write a program that will print the numbers between m and n, where the value of m and n
will be inputted by the user.
Q.4. Write a program that will print all odd numbers between m and n, where the value of m
and n will be inputted by the user.
Q.5. Write a program to find the sum and average of numbers from 1 to n, where the value of n
will be inputted by the user.
Q.6. Write a program to find the factorial of a number, where the number will be inputted by
the user.
Q.7. Write a program that will read two integers and compute the GCD.
Q.8. Write a program that will read two integers and compute the LCM.
Q.10. Write a program that will read a number and compute sum of its digits.
Q.11. Write a program that will reverse a number inputted by the user.
Example: If number is 3456 then its reverse should be 6543
Q.12. Write a program to read a number, count the number of digits and display.
Q.13. Write a program that will check an inputted number is prime or composite.