Professional Documents
Culture Documents
2) Write a program that will read a line of text in lowercase and convert it into uppercase
using
a) while loop
b) do while loop
c) for loop
3) Generate a program that will generate the outline of a diamond shape using the *
character, i.e. your program should output something like the following (using
imbedded loops)
**
* *
* *
* *
* *
* *
* *
**
4) Write a program that will generate the 1st N fibonacci numbers i.e., where N is inputted
by the user
1 1 2 3 5 8 13 etc…
5) Write a program that will generate the following pyramid of digits
1
232
34543
4567654
567898765
6) Write a program that will allow the computer to be used as an ordinary desk
calculator. Consider only addition, subtraction, multiplication and division