Store first n natural no in a file - c program, C/C++ Programming

Program is to store first n natural no in a file:

Write a program to store first n natural no in a file

void main()

    {

    fstream file;

    file.open("student.dat",ios::in|ios::out|ios::app);

    int n;

    cout<<" enter record to be modified ";

    cin>>n;

    file.seekg((n-1)*sizeof());

    file.read((char *)&  ,sizeif());

    file.write((char *)&  ,sizeof());

    file.close();

    }

Posted Date: 10/19/2012 5:37:09 AM | Location : United States







Related Discussions:- Store first n natural no in a file - c program, Assignment Help, Ask Question on Store first n natural no in a file - c program, Get Answer, Expert's Help, Store first n natural no in a file - c program Discussions

Write discussion on Store first n natural no in a file - c program
Your posts are moderated
Related Questions
Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.


A: N delete p is a two-step procedure: it calls the destructor, and then releases the memory. The code developed for delete p is functionally similar to this (supposing p is of typ

Write a function that has a single int parameter n and returns an int: 0 if n is negative, otherwise 1. You are not allowed to simply check the integer value, and should use the fu

Define the Bitwise-Exclusive-OR Operator: ^: The bitwise-exclusive-OR operator (^) compares every bit of its first operand to the corresponding bit of its second operand. If on

Write a program to get the largest element in an array using Function? # include int largest(int b[],int); main() { int lar,a[5]={12,2,36,40,5}; lar=largest(a,n); printf("

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year


convert string s into palindrome by doing character replacement

Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl