Engineering
Engineering, 05.05.2020 23:23, tinytoonjr9510

Write a program that prints a one-month calendar. The userspecifies the number of days in the month and the day of the weekon which the month begins. The numerical dates must line up sothat the rightmost digit of the date is aligned with the rightmostdigit of the date above or below it (if there are anysuch). Below is an example output showing theformat you should use. The user input is shown as underlinedtext. Enter number of days in month: 31Enter starting day of the week (1=Sun, 7=Sat): 3 1 2 3 4 56 7 8 9 10 11 1213 14 15 16 17 18 1920 21 22 23 24 25 2627 28 29 30 31This program isn’t as hard as it might seem. The mostimportant part is a for statement that uses a variable i to countfrom 1 to n, where n is the number of days in a month, printingeach value of i. Inside the loop, an if statement testswhether i is the last day in a week; if so, it prints anewline. Note that the two digit dates that start a week arealigned with the left margin. Here's what I have so far.#includeint main(){int i, days, start;printf("Enter number of days in month:",days);scanf("%d", &days);printf("Enter starting day of the week (1=Sun, 7=Sat):",start);scanf("%d", &start);for(i=1;i<=days;i++) { printf("%3d", i); if(i == 7 || i == 14 || i == 21 || i == 28) { printf("\n"); } }return 0;}

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, johnthienann58
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
image
Engineering, 04.07.2019 18:10, dval1146
You are making beer. the first step is filling the glass carboy with the liquid wort. the internal diameter of the carboy is 15 in., and you wish to fill it up to a depth of 2 ft. if your wort is drawn from the kettle using a siphon process that flows at 3 gpm, how long will it take to fill?
Answers: 1
image
Engineering, 04.07.2019 18:10, Larkinlover703
Items are similar to the free issue items, but their access is limited. (clo5) a)-bin stock items free issue b)-bin stock controlled issue c)-critical or insurance spares d)-rebuildable spares e)-consumables
Answers: 1
image
Engineering, 04.07.2019 18:20, karatsgrande3772
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10ä1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
Do you know the correct answer?
Write a program that prints a one-month calendar. The userspecifies the number of days in the month...

Questions in other subjects:

Konu
Mathematics, 16.09.2019 09:50