You are on page 1of 1

Assignment

1. Write a program to keep asking for a number until you enter a negative
number. At the end, print the sum of all entered numbers.
2. Write a program to find first and last digit of any number.
3. Write a C++ program to print Fibonacci series up to n terms using loop. How to generate
Fibonacci series up to n terms using loops in C++ programming. Logic to print Fibonacci series in
a given range in C++ programming. Example
Input
Input number of terms: 10
Output
Fibonacci series:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34
4. Write a program that print this pattern using nested loop.
*
**
* *
* *
* *
* *
*******
5. Write a program that print this pattern using nested loop.
54321
4321
321
21
1
6. Write a program that print this pattern using nested loop.

*********
*******
*****
***
*
7. Create a calculator using do while loop it takes two number and one operator from the user and
perform the operation. After that, it shows a message to the user that if you want to perform more
calculations press 1 or press any key to end the program.

You might also like