Computer Science, asked by abdulhaseeb03157, 1 month ago

write a program in c++ to save the name and address in a file

Answers

Answered by at8620280
4

Answer:

#include<iostream>

using namespace std;

void main() {

cout << "Name :: John" << endl

<< "Address :: House#12 LA Streat New York" << endl;

}

Answered by anjaliom1122
0

Answer:

A program in C++ to save the name and address in a file:

Explanation:

include <iostream>

using namespace std;

struct student

{

   char name[50];

   int roll;

   float marks;

};

int main()

{

   student s;

   cout << "Enter information," << endl;

   cout << "Enter name: ";

   cin >> s.name;

   cout << "Enter Address ";

   cin >> s.address;

   cout << "\nDisplaying Information," << endl;

   cout << "Name: " << s.name << endl;

   cout << "Address: " << s.address<< endl;

 

   return 0;

}

Similar questions