1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lisov135 [29]
3 years ago
9

Write a program that prints a one-month calendar. The userspecifies the number of days in the month and the day of the weekon wh

ich 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;}
Engineering
1 answer:
Rama09 [41]3 years ago
8 0

Answer:

See explaination

Explanation:

#include<stdio.h>

#include<conio.h>

int main()

{

int days,start,i;

printf("Enter number of days in month: ");

scanf("%d",&days);

printf("Enter starting day of the week (1=Sun, 7=Sat):");

scanf("%d",&start);

printf("\nSun Mon Tue Wed Thu Fri Sat\n");

for(i=0;i<start-1;i++)

printf(" ");

for(i=1;i<=days;i++)

{ if (i<=9)

printf(" ");

printf("%d",i);

if ((start-1+i)%7==0&&i!=days)

printf("\n");

else

printf(" ");

}

printf("\n");

getch();

}

You might be interested in
The asymmetric roof truss is of the type used when a near normal angle of incidence of sunlight onto the south-facing surface AB
marysya [2.9K]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step explanation to the question above.

6 0
4 years ago
At what distance should the warning triangle be placed if a vehicle breaks down on the autobahn?
igor_vitrenko [27]

Answer:

The answer is 200 Meters

Explanation:

At what distance should the warning triangle be placed if a vehicle breaks down on the autobahn?

200 Meters

The Autobahn is the federal controlled-access highway system in Germany. The official German term is Bundesautobahn, which translates as "federal motorway". The literal meaning of the word Bundesautobahn is "Federal Auto Track".

4 0
4 years ago
The _______ is a tendency to assume that people with one positive attribute (e.g., who are physically attractive) also have othe
morpeh [17]

Answer:

Halo effect

Explanation:

In psychology, halo effect is defined as the tendency to assume that people with one positive attribute (e.g. physical attractiveness) also have other positive traits. Mere Exposure is the tendency to feel more positively toward a stimulus as a result of repeated exposure to it.

7 0
3 years ago
Which sentence highlights the best way of site planning?
Nadusha1986 [10]

Answer:

Which sentence highlights the best way of site planning?

A group of construction planners are in a discussion over the most suitable plot to construct new buildings. Steven suggests that they should choose the barren stretch of land in the city and construct cluster buildings. James points out that the wetlands will provide them more area for construction. Riley advises that they should not worry about keeping large open spaces while planning building construction.

Explanation:

8 0
3 years ago
To solve the problem, make assumptions for missing data and justify. Given:
finlep [7]

Answer:

5,4,1, this is a explication

6 0
3 years ago
Other questions:
  • If you measure 0.7 V across a diode, the diode is probably made of
    6·1 answer
  • Determine whether each of the following statements is true, false, or uncertain. Explain your answers. A decision maker seldom k
    14·1 answer
  • Which of the following is an example of seeking accreditation?
    7·1 answer
  • The impeller shaft of a fluid agitator transmits 28 kW at 440 rpm. If the allowable shear stress in the impeller shaft must be l
    6·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    10·1 answer
  • The radiator of a steam heating system has a volume of 20 L and is filled with superheated water vapor at 200 kPa and 200°C. At
    7·1 answer
  • What is a specialized accreditation? A. evaluation of the quality of instruction B. evaluation of a particular program C. evalua
    13·1 answer
  • Please help due by end of the day!!!! I need the code for 5 and 7, Milky Way in coderz. will mark brainliest answer.
    10·2 answers
  • What is the aim of reviewing a research paper?
    8·2 answers
  • Why would a Military Base be considered a Planned Community?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!