consider the following program
#include<iostream.h>
#include<fstream.h>
void main()
{
int no;
ifstream fin;
ofstream fout;
fout.open("create,dat",ios::app);
fout<<"What is your fav. number";
fin>>no;
fout<<no;
fout.close();
}
NOW HERE IS THE PROBLEM WHILE THE PROGRAM IS RUNNING PERFECTLY AND THE NUMBER IS BEING STORED IN A .DAT FILE BUT THE NUMBER IS NOT GETTING DISPLAYED IN THE NORMAL OUTPUT MODE (WHICH COMES UP WHEN YOU COMPILE AND RUN A PROGRAM,CTR+F9)
Also i dont want to write cout followed by fout because that will double the number of lines nd make my program redundant though i know that it will work but still i dont like it....
CAN ANYONE PLEASE HELP ME IMPROVE ME CODE SO THAT I CAN DISPLAY THE NUMBER IN THE OUTPUT MODE TOO(without making the program redundant and repetitive).....