C PROGRAMMING ONLY) 1. Dealing With Months by CodeChum Admin We're done dealing with days. It's time to step up and now deal with months!   Instructions: In the code editor, you are provided with a code in the main() which has 12 printf's. Each printf prints a month with its corresponding value. For this program, January is 1, February is 2, March is 3, and so on. When you run the initial code, you will encounter errors because these month names that have been printed don't exist yet. Your task is to create an enum data type which contains these month names as values so that when we run the code, there will be no more error. Do not edit anything in the main(). Output January = 1 February = 2 March = 3 April = 4 May = 5 June = 6 July = 7 August = 8 September = 9 October = 10 November = 11 December = 12

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question

(C PROGRAMMING ONLY)

1. Dealing With Months
by CodeChum Admin

We're done dealing with days. It's time to step up and now deal with months!

 

Instructions:

In the code editor, you are provided with a code in the main() which has 12 printf's. Each printf prints a month with its corresponding value. For this program, January is 1, February is 2, March is 3, and so on. When you run the initial code, you will encounter errors because these month names that have been printed don't exist yet.
Your task is to create an enum data type which contains these month names as values so that when we run the code, there will be no more error.
Do not edit anything in the main().


Output

January = 1
February = 2
March = 3
April = 4
May = 5
June = 6
July = 7
August = 8
September = 9
October = 10
November = 11
December = 12

main.c
1
#include<stdio.h>
2
3 int main() {
4
5
6
234 68
MAIN()
// NOTE: DO NOT EDIT THE
printf("January = %d\n", Jan);
printf("February = %d\n", Feb);
printf("March = %d\n", Mar);
=
printf("April
printf("May
%d\n", Apr);
%d\n", May);
=
9
10
11
12
printf("June = %d\n", Jun);
printf("July = %d\n", Jul);
printf("August = %d\n", Aug);
printf("September = %d\n", Sep);
printf("October = %d\n", Oct);
printf("November = %d\n", Nov);
13
14
15
16 printf("December = %d\n", Dec);
17
18
return 0;
19}
7
+ c
Transcribed Image Text:main.c 1 #include<stdio.h> 2 3 int main() { 4 5 6 234 68 MAIN() // NOTE: DO NOT EDIT THE printf("January = %d\n", Jan); printf("February = %d\n", Feb); printf("March = %d\n", Mar); = printf("April printf("May %d\n", Apr); %d\n", May); = 9 10 11 12 printf("June = %d\n", Jun); printf("July = %d\n", Jul); printf("August = %d\n", Aug); printf("September = %d\n", Sep); printf("October = %d\n", Oct); printf("November = %d\n", Nov); 13 14 15 16 printf("December = %d\n", Dec); 17 18 return 0; 19} 7 + c
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of memory addresses in pointers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT