Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Friday, May 20, 2011

C33 : Enter student name,roll no,and marks and store it in a file called stud

Back to Home   &  C


//Program to enter student name,roll no,and marks and store it in a file called stud


#include<stdio.h>
#include<conio.h>
void main()
{
int rno;
char name[20];
float mark;
FILE*fp;
fp=fopen("stud","w");
clrscr();
printf("Enter student roll number");
scanf("%d",&rno);
printf("Enter name");
scanf("%s",name);
printf("Enter mark");
scanf("%f",&mark);
printf("Writing to file...\n");
fprint(fp,"%d%s%f",rno,name,mark);
getch();
}
---------------------------------------------------
Output:

=========================================================================
Back to Home   &  C

1 comment: