Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.1 Specification Write an ANSI-C program that reads input from the Standard Input, and then outputs the reformatted versions of the input. 1.2 Implementation You
1.1 Specification Write an ANSI-C program that reads input from the Standard Input, and then outputs the reformatted versions of the input. 1.2 Implementation You can download the file hello.c and use it as a template. name your program lablA.c use scanf to read input (from Standard Input), which are in the form of Month Day Year i.e., three integers separated by white spaces) use printf to generate output in the format of Year/month/day and Year-month- day display the following prompt (leave a white space after the colon) Enter month, day and year separated by spaces: display output as follows The input 'x xx xxxx' is reformatted as x/xx/xxx and x-xx-xxx Note: you should do the reformatting only within printf. In particular, you should use at most three variables, and feed them into printf judiciously. 1.3 Sample Inputs/Outputs: red 306 % gcc lab1A.c red 307 % a.out Enter month, day and year separated by spaces: 3 20 2019 The input '3 20 2019' is reformatted as 2019/3/20 and 2019-3-20 red 308
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started