We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search


+ Link For Assignments, GDBs & Online Quizzes Solution


+ Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

See attached file ...................

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

See Your Saved Posts Timeline

Views: 302


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Replies to This Discussion

bahe in how form we submit this ......

run .cpp without the .txt file then the program won't run...we have to submit .cpp file only not .cpp+.txt

kia hum .tex file bhi upload kraan gay??????

thank u 4 this

( @ syed nashit. First we have to create a file through " c++ code"  and then Open file and read data from it and display it on the screen ) so no need to upload the .txt file.

read the Detailed Description:

Write a C++ program in which you have to: 

1. Create a text file “Electricity_Bill”.

2. Write following data in it:

3. Open file and read data from it and display it on the screen.

#include <fstream>

#include <iostream>
using namespace std;
int main()

{  char str[10];
  //Creates an instance of ofstream, and opens example.txt 

ofstream a_file ( "Electricity_Bill.txt" ); 

// Outputs to example.txt through a_file 

a_file"This text will now be inside of Electricity_Bill.txt"; 

// Close the file stream explicitly 


ifstream inFile;

char inputFileName[]="Electricity_Bill.txt";

const int MAX_CHAR_TO_READ = 100;

char completeLineText[MAX_CHAR_TO_READ];


cout "Invalid file name: " inputFileName endl;





cout completeLineText endl;





hello friends i can create a text file through coding but unable to put the whole data in text file.please test this code and also help me how i put the full data into in


thanks dude!!!


zeeshan bhai yeh program tu sahi ban gia hai but data full enter nahi ho raha yehi just problem hai.ab file .text create b coding k through ho rahi hai aur read aur write b.just data ka problem hai.





Today Top Members 

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service