Write a program in C that reads a line of text into the computer and then writes back out in its original form

Below is the C program that reads a line of text into the computer and then writes back out in its original form

Explanation
Step 1: Read the line of text by using the library function gets() and store it in an array
Step 2: Display the read line by using the library function puts()

Program:

#include<stdio.h>

void main()
{
   char line[80];
   gets(line);
   puts(line);
}

Output:

Learn C Online is the best tutorial website to learn C

Learn C Online is the best tutorial website to learn C

You may also like...

3 Responses

  1. abhishek says:

    Its a fabulous app

  1. October 25, 2017

    […] C program that reads a line of text into the computer and then writes back out in its original form […]

Leave a Reply

Your email address will not be published. Required fields are marked *

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet