Store marks and name, roll no in a file - c program , C/C++ Programming

Assignment Help:

Program is to store marks and name, roll no in a file:

class stud

  {

    int rno;

    char name[20];

    int m1,m2,m3;

    public:

                void accept()

                                {

                                cout<<"enter the roll no. : ";

                                cin>>rno;

                                cout<<"enter the name : ";

                                gets(name);

                                cout<<"enter marks of 3 subjects : ";

                                cin>>m1>>m2>>m3;

                                }

    };

     void main()

     {

     clrscr();

     stud s;

     s.accept();

     ofstream a ("stud.dat" , ios::binary | ios::app);

     a.write ( (char *) &s , sizeof(s) );

     a.close();

     }


Related Discussions:- Store marks and name, roll no in a file - c program

Bankers algorithm, creating a system having five process from p0 to p4 and ...

creating a system having five process from p0 to p4 and five resource types. create the need matrix use the safe algorithm to test if the system is in safe mode.

Inheritance, example of program to ad two numbers

example of program to ad two numbers

Write a program that finds the minimum total number of shelv, At a shop of ...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

C++ project, project on business management

project on business management

Write a program to test the class, Problem Implement a class called emp...

Problem Implement a class called employee that contains name, employee number and department code. Include a member function getdata() to get data from user and store it in the

What is token in programming languages, T o k e n :  Tokens  are  s...

T o k e n :  Tokens  are  small  entities  in  a  program.    Example: identifiers,  keywords,  constants, operators, strings, etc.  These tokens are used almost in same wa

factorial series, 1)      Factorial (for this question just provide an a...

1)      Factorial (for this question just provide an answer for each part)  1.1  Debug the following program to calculate N! #include using namespace std; main()

Multiple constructor, Constructor public class ListNode {    //...

Constructor public class ListNode {    // package access members; List can access these directly private E data; // data for this node privateListNode nextNode; /

What should one catch?, A: By keeping along with the C++ tradition of "ther...

A: By keeping along with the C++ tradition of "there's more than one method to do that" (translation: "give programmers options & tradeoffs so they can choose what's best for them

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd