00 Diagnostic Exer D

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CS 21 Fundamentals of Programming Diagnostic Exercise

(SET D) Implement a solution using C or Python for the following problems.

1. Vs
Create a program that asks for any integer n, n > 2, and then prints a letter V of height n. The V is
created by printing a series of asterisk in the terminal.
(String multiplication is NOT ALLOWED.)

Input ( N ) : 1
Output : Invalid !

Input ( N ) : 3 Input ( N ) : 9
Output : * * Output : * *
* * * *
** * *
* *
Input ( N ) : 6 * *
Output : * * * *
* * * *
* * * *
* * **
* *
**

2. Digits to Words Converter


Create a program that asks for a number N , N > 0 and N ≤ 5000, and then outputs each digit in words.
Examples:
1234 = One Two Three Four 2018 = Two Zero One Eight 8888 = Eight Eight Eight Eight

2nd Semester, A.Y. 2018-19

You might also like