Assignment 4: More on Selection statements and Loops Solution

$30.00

Category:

Description

Programs:

 

  1. Write a program that prints the following triangle:

 

*

* *

 

* * *

* * * *

* * * * *

 

  1. For the following program ask the user to enter the number of rows that needs to be displayed and print in the following format:

 

For ex:

 

Enter the number of rows you want in the triangle: If input is 5, it needs to be displayed like this:

 

*

* *

*  * *

 

*  * * *

*  *  * *  *

  1. Write a program that prints a one-month calendar. The user specifies the number of days in the month and the day of the week on which the month begins:

 

Enter number of days in month: 31

Enter starting day of the week (1=Sun, 7=Sat): 3

 

1   2   3   4   5

  • 7 8  9 10 11 12

13 14 15 16 17 18 19

20 21 22 23 24 25 26

27 28 29 30 31

 

  1. Write a program to print Fibonacci series up to n number of terms.

Write pseudocode to solve the given problems.

Write C program to solve the above problems. Name your file Lab4_YourName.c


error: Content is protected !!