Write a program to read and print a text file on screen

Answer Posted / ashwek

/// Using C++

#include<iostream>
#include<fstream>
#include<stdio.h>

int main(){

char Data[200];
ifstream File("FILE_NAME"); //Opening a File

while(File){ //Run until End of file
File.getline(Data, 200); //Read data from file & store in Data (string)
cout<<Data; //Print data
}
File.close();

return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of element of in Ajax

2015


WHat is execution in manual testing and when will we start execution and what language we use in execution

1486


what is programmable BIST in today ic design

1649


Explain the types of operations? Draw the figure for shift and rotate operations?

2811


where is available in this mantis toturials?

1614






design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.

16238


Tag for turning an image into a hyperlink is

1845


what is the basic and unique feature of dotnet

1718


what are the topics choosen for jam round for interviews

1162


how pseudo column works?

1723


write a sql qwery which include joining of two tables 4 marks mainframe

1495


What is test execution and when will we start execution please send me one example for this question

1433


give idea for creating screen in abap

1647


9.Difference between even and odd signals?explain with the diagram?

2969


How do you pass variables forwrd to future CECI sessions

4083