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
Program to define an array in c: Write a program to define an array and print the value of array. void main() { int a[10]={0,11,21,34,44,75,46,57,88,89},i,j,k; clr

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t

Objective Using C++ string, classes, constructors and member functions. Task A Write a program (book.cpp) to store a list of book titles and the published dates. Your pro

how to use nested loop of for in array

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

write a javaprogram to solve padovan string using java? program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring;

It''s that spooky time of year when the dead walk the Earth, things go bump in the night, and the Centers for Disease Control (CDC) recognizes the need for zombie preparedness (

The for Loop For loop is the controlled form of loop. The general format of this : for( initialize ; test ; update)                  {                     statements;

Question : (a) Define a Pointer. Provide an example of an integer pointer variable. (b) Give advantages of using pointers over arrays. (c) Declare an integer pointer

C Program for SORTING OF LONG WORD WITH DIFFERENT STRING #include stdio.h> #include conio.h> #include string.h>   void main() {           char n[50],c[25][25]