0% found this document useful (0 votes)
6 views1 page

AssIgnment 3(Loops)

The document outlines a series of programming assignments focused on using looping statements such as for, while, and do-while. Each assignment requires writing a program to perform specific tasks, including printing names, calculating sums, finding factorials, and checking for prime numbers. The tasks are designed to enhance programming skills through practical applications of loops and mathematical concepts.

Uploaded by

Apurba Mohanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

AssIgnment 3(Loops)

The document outlines a series of programming assignments focused on using looping statements such as for, while, and do-while. Each assignment requires writing a program to perform specific tasks, including printing names, calculating sums, finding factorials, and checking for prime numbers. The tasks are designed to enhance programming skills through practical applications of loops and mathematical concepts.

Uploaded by

Apurba Mohanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment-3

Using Looping statements (for, while, do-while)


Q.1. Write a program that will print your name 10 times

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.9. Write a program to print the Fibonacci numbers up to n number of terms.

Q.10. Write a program that will read a number and compute sum of its digits.

Example: If input is 315, then output should be 9

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.

Example: If input is 3405, then output should be 4

Q.13. Write a program that will check an inputted number is prime or composite.

Q.14. Write a program that will check a number is palindrome or not.


Example: 12321 is a palindrome, but 12345 is not
Q.15. Write a program that will print sum of the following series
Sum = 1+ 1/2! + 1/3! + …..1/n!
Q.16. Write a program that will read x and compute sin(x)
(Hints: Use Taylor’s series expansion sin(x)= x- x3/3! + x5/5! – x7/ 7! + ··· )

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy