You are on page 1of 2

Question 6:

Write a program that reads a number N and outputs the shape of a tornado of size N. The following are
examples:

Tornado of size 7 Tornado of size 4 Tornado of size 1

******* **** *
******* **** *
****** ***
****** ***
***** **
***** **
**** *
**** *
***
***
**
**
*
*

Question 7:
Write a program that prints the shape of a square of N x N using (dots(.) , digit 1 and digit 2 )
for the given input N. Both diagonals of the square will be represented by dots. The dots of
the diagonals will separate the square into 4 triangles (upper, left, right and lower). Right and
upper triangles will be represented by ones, while left and lower will be represented by twos. For
example, if the input is 9 then the function should print the following: (Your function should
generate any square for given N)

.1111111.
2.11111.1
22.111.11
222.1.111
2222.1111
222.2.111
22.222.11
2.22222.1
.2222222.
Write a C program that reads grades for an unknown number of student. Your program must do the
following

1. Read 3 integer values representing the grades for each student.


2. Calculate and print to the screen the average grade for each student.
3. Print to the screen the highest average of all students along with the student index or number.
4. Based on the grades entered in 1, print the letter grade corresponding to each grade using
switch statement.

Hint: Use -1 to denote the end of input

Q8

Write a program to print the following triangle using numbers:

23

345

4567

56789

You might also like