answersLogoWhite

0


Best Answer

#include<stdio.h>

void main()

{

FILE *fp;

char name[20],ch;

char *roll;

fp=fopen("specifies file path","w");

if(fp!=NULL)

{

do{

printf("input roll_no");

gets(roll);

printf("\ninput student name");

gets(name);

fputs(roll,fp);

fputs("\t",fp);

fputs(name,fp);

fputs("\n",fp);

printf("you want to continue y/n");

ch=getch();

}while(ch=='y');

}

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A C program to store students record in a file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can write a c program to store students record in a file?

Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo,


You want C program on students information record using file handling?

yes sir


This collection of cradle to grave records is the permanent historical record of an AFOTEC test program?

Test Program Case File


What one tool will help you start an effective record management program?

File Plan


Write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student?

write a program which reads names of students and their telephones from a file and produce a linked list ordered in alphabetical order by the surname of the student.


Is it more efficient to store the data in a matrix then write it to the file at the end of the program or to write each element to the file as the program runs?

It shouldn't make significant difference, only if the matrix is huge -- in that case you shouldn't store it in memory.


At the beginning of the boot drive is the OS which loads the first program file of the OS?

boot record


What is exactly a logfile?

A log file is automatically created by programs to store information about the actions performed by that program. It is usually a text file stating either operations of the program or the errors encountered while the program was executed.


How to store the file in array variable using perl?

As simple as that. If your Perl is in: /usr/bin/perl, then just copy and paste the text below in a file (e.g. my_prog.pl), make my_prog.pl executable (chmod u+x my_prog.pl) and execure this (./my_prog.pl) . I hope my comments will allow you to adapt this small script according to your needs. ---- #!/usr/bin/perl ########################### #### This is how you open the file #### ########################### # First define the "record delimiter", if you wish. Options: # $/ = "\n" # One line is one record! This is the default, no need to be defined. # $/ = "\n\n" # An enpty line is the record delimiter (useful for mail headers, etc.) # $/ = "you_name_it!" # According to your specific problem. # try opening the file for reading and associate it with the # "File Pointer" FP. If you fail the msg below will be printed # and the program will halt. open (FP, '/etc/hosts') or die('Cannot open file for reading'); ################################# #### This is how you store the file in arrary #### ################################# # Read the file; here record=line. my @records = ; # and do not forget to close FP close FP; ####################### #### This is how you test it #### ####################### # Print them, just for testing foreach my $record (@records) { chomp $record; # Get rid of the trailing "\n" that apears in each line $record = "[$record]"; # Wrap the record in [] for the sake of presentation print "$record\n"; } ----


What does the program 7- zipdo fot yjr file on your computer?

The program 7- Zipdo is a software for a computer. This software is made to store code in the computer.


When was File for Record created?

File for Record was created in 1943.


What program is used to run a file with a dvm format?

The DVM file extension is associated with the DVM Movie File Format. It is used to store small animations and movies, developed by Magic Software.