Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me with this C program: I need these two programs to be combined to transpose a txt file. C code rules such as

Please help me with this C program: I need these two programs to be combined to transpose a txt file.

C code rules such as variables can only be declared at the top of functions and the file and please use #include, #include, #include

Please do not use cin or count statements and make the program simple and easy to read.

image text in transcribed

image text in transcribed

image text in transcribed

Here's a text file to use for the names:

image text in transcribed

I need these two programs to be combined to transpose a txt file.

C code rules such as variables can only be declared at the top of functions and the file and please use #include, #include, #include

Please do not use cin or count statements and make the program simple and easy to read.

#include #include #include void main(void) char string [80] = "test"; int place = @; printf("This program prints your input downward. In "); printf("Type in a phrase to print down: "); gets(string); printf("You entered in %s in and downward is ", string); while(string[place] != '\0') printf("%c ", string[place]); place =place+1; #include #include #include void main(void) FILE *names, *trans; char astring[81]; printf("This program reads from names.txt and writes to trans.txt. "); in = fopen("names.txt","r"); out = fopen("trans.txt", "w"); fgets(astring, 80, in); printf("The text from in.txt is In %s ", astring); fprintf(out, "The next from in.txt is In %5 ", astring); fclose(in); fclose(out); Write a C program called transpose.c that reads in 15-20 family and friends (one first and last name on a line) or 15-20 computer game names (some need to have multiple words) from the file names.txt. Put the names into the array char names [20] [60]; (make sure the names are less than 59 characters each). Write the names out to the screen and to a file called trans.txt so the names can be read down instead of across and add a couple of spaces between each character across. Watch out for '\0' and ' ' characters! For example, Carol Joe R Neil ... becomes CJ N a oe re i 01 1 R ... Help names - Notepad File Edit Format View Spurs Raptors Celtics Seventy Sixers Nets Knicks Bucks Pacers Pistons Bulls Cavaliers Heat Magic Hornets Wizards

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

What could Kathy have done to keep the situation from occurring?

Answered: 1 week ago

Question

LO2 Compare three types of individual incentives.

Answered: 1 week ago