Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**************PLEASE EXAMINE MY ANSWER AND RESPOND TO IT!!!!!!!!!!!!!!!!!!!!!!!! DO NOT JUST POST A GENERAL SOLUTION AS I NEED SPECIFIC HELP ON SPECIFIC PARTS OF THE

**************PLEASE EXAMINE MY ANSWER AND RESPOND TO IT!!!!!!!!!!!!!!!!!!!!!!!! DO NOT JUST POST A GENERAL SOLUTION AS I NEED SPECIFIC HELP ON SPECIFIC PARTS OF THE PROBLEM, NOT JUST A GENERIC ANSWER.**********************

Write a C program that will display text on any terminal. The program should first prompt the user for the name of the device ?le for the terminal on which to display output, as well as the output to display. It should then perform the necessary I/O operations. This process should repeat until the user decides to exit the program.

FEEDBACK: The only part I cannot get to work is writing and reading to the file. Please help me with this section of my code.

MY ANSWER:

image text in transcribed

image text in transcribed

#include int main) FILE *fpt; char c[30]; char words; char text[30]: while(1) printf("Enter the terminal to display in (Q to quit): "); scanf("%s" if(c[0] 'Q') return 0; printf("Enter the text to display:"); scanf("%s", &words); if(c[9] '0') == fpt fopen( "c","w"); fprintf(fpt, "%s", &words); fclose(fpt); fpt = fopen ( "c","r"); fscanf(fpt,"%s", text); printf("%s ", text); fclose(fpt); else if(c[9] |-'0') printf("Unable to open %s for writing", &words)

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

2. What appeals processes are open to this person?

Answered: 1 week ago