Develop a program that when you pipe in a file

Assignment Help C/C++ Programming
Reference no: EM13162997

develop a program that when you pipe in a file it will demonstrate on the left had side the line number. I need this to work by having a program piped in and when a \n occurs a new line and number is indicated. Someone helped me earlier but that was only for character by character. for line by line. I know the basic set up I need need help executing this program.

 

#include <stdio.h>

#include<string.h>

 

int main(){

char inp[1000];

int i;

printf("Enter the input:\n");

scanf("%s", &inp);

for(i = 0; i < strlen(inp); i++){

printf("%d %c\n", i + 1, inp[i]);

}

return 0;

}

 

 

Reference no: EM13162997

Questions Cloud

Describe the content, purpose, user access methods : describe the content, purpose, user access methods, and sources of data
Calculate the number of grams of sodium used in the reaction : The hydrogen gas generated is collected over water at 25.0°C. The volume of the gas is 295 mL measured at 1.00 atm. Calculate the number of grams of sodium used in the reaction. (Vapor pressure of water at 25°C = 0.0313 atm.)
What is the molecular weight of the gas : 2.58g of a gas has a volume of 3.97L at 745mmHg and 21 degrees celcius. What is the molecular weight of the gas?
How much potassium chlorate is needed to produce : The decomposition of potassium chlorate (KClO3) is used as a source of oxygen in the laboratory. How much potassium chlorate is needed to produce 20.7 mol of oxygen?
Develop a program that when you pipe in a file : develop a program that when you pipe in a file it will demonstrate on the left had side the line number  work by having a program piped in and when a \n occurs a new line and number is indicated.
Determine the gram-formula mass of the product : Determine the gram-formula mass of the product of this reaction. Include proper units.
What is the pressure of a container : What is the pressure of a container that has 7 atm pressure coming from O2, 2 atm of pressure coming from N2, 3 atm of pressure coming from CO2?
What is the specific heat for the metal : It takes 47.0 J to raise the temperature of an 9.00 g piece of unknown metal from 13.0rm ^circ C to 25.0^circ{C}. What is the specific heat for the metal?
Calculate the mass of propylene glycol : Calculate the mass of propylene glycol ({rm{C}}_3 {rm{H}}_8 {rm{O}}_2 ) that must be added to 0.340 kg of water to reduce the vapor pressure by 2.86 torr at 40 ^circ ,{rm C} (P_{{rm H}_2{rm O}} at 40 ^circ,{rm C} = 55.3;{rm torr}).

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd