file1 by blogmajeed

VIEWS: 0 PAGES: 1

More Info
									#include<iostream.h>
#include<conio.h>
#include<fstream.h>
int main()
{
    ofstream outf("ITEM");
    clrscr();
    cout<<"Enter item name:";
    char name[30];
    cin>>name;
    outf<<name;
    cout<<"Enter item cost:";
    float cost;
    cin>>cost;
    outf<<cost<<endl;
    outf.close();
    ifstream inf("ITEM");
    inf>>name;
    inf>>cost;
    cout<<endl;
    cout<<"Item name:"<<name<<endl;
    cout<<"Item cost:"<<cost<<endl;
    inf.close();
    getch();
    return 0;
  }

								
To top