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
any drawback are there in mantis?
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.
what is delegate and delegation model give the real live example on delegate model
design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.
How to call a C++ function which is compiled with C++ compiler in C code?
how to stop execution of step 3 in a job mainframe
what is the use of occurs 10 or (any number) in the internal table declaration with header line.
How will you prove that java swing is multithreaded?
Difference between delegates and Events?
pleasew define carrier scope in abap (sap).
can u send some model papers how computer awareness questions are asked in goverment jobs(oriental insurance)to my mail id me.priyankapadma@rediff.com
What is SOLID Principle in Programming Language?
differences between qtp10.0 and 11.0 ?
how to add a new table with variables and thier values into a imported file uisng proc import?
Have you used callsymputx? what points need to be kept in mind when using it?