From 83ec664cfc6ce056fc4225bc8a5a298e2771231b Mon Sep 17 00:00:00 2001 From: Raghav Babbar <89309326+BabbarRaghav@users.noreply.github.com> Date: Sat, 2 Oct 2021 20:51:35 +0530 Subject: [PATCH] Create fstream.cpp Please accept my pull request. I participated in Hacktoberfest for the first time. --- Cpp/fstream.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Cpp/fstream.cpp diff --git a/Cpp/fstream.cpp b/Cpp/fstream.cpp new file mode 100644 index 0000000..7d5e1c5 --- /dev/null +++ b/Cpp/fstream.cpp @@ -0,0 +1,23 @@ +#include +#include +using namespace std; +int main() +{ + ofstream outf("student"); + int no; + char name[30]; + cout<<"Enter Roll Number:-\n"; + cin>>no; + cout<<"Enter Name:-\n"; + cin>>name; + outf<>no; + inf>>name; + cout<<"\n Roll Number is "<