Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Notes: This question about Unix Exercises : The following exercise are designed to get familiar with Unix (Linux) systems. For the result please include the

Notes:

This question about Unix Exercises :

The following exercise are designed to get familiar with Unix (Linux) systems.

For the result please include the terminal test outputs ( should include command line as well )

image text in transcribed

Please capture the INPUT and OUPUT

image text in transcribed

Question 5 scanf Again Assume the input is in the form of date-month-year, such as 8- August-2006, how would you read the date, the month and the year? Note in this case, the month is not a number. It is a string. See the following code: int date; char month (BUF SIZE]; int year; printf("Please enter the date in the form of date- short month-year, "); printf(" such as 8-Aug-2006, where a month is written in exactly three letters: "); scanf("%d-%35-%d", &date, month, &year); Please note in scant, we pass the address of array month without using the address operator &. This is because the array name month itself represents the starting address of the array. Convert the above code into a complete program and test it with date inputs. /home/send_output_to_file.c-Sublime Text (UNREGISTERED) Selection Find View Goto Tools Project Preferences Help File Edit root@acer /home File Edit View Search Terminal Help root@acer:/home# gcc send output_to_file.c 66./a.out root@acer:/home# cat foo2 this is output root@acer:/home# send output_to_file.cx 1 #include 2 #include 3 int main(int argc, char const *argv[]) 4 { char *fname = "f0o2"; FILE *fstr; Please Capture like this fintf(stderr, "cannot open file %s, exit(1); } 7/ need to send output to file foo2 freopen(fname, "w", stdout); // this can b is is output "); return 0; 20 21 } Line 21 Column 2 Tab Size: 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions