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

C34 : Read student details from a file called stud

Back to Home   &  C


//Program to read student details from a file called stud

#include<stdio.h>
#include<conio.h>
void main()
{
int rno;
char name[20];
float mark;
FILE*file1;
clrscr();
file1=fopen("stud","r");
printf("Reading data from file...\n");
fscanf(file1,"%d%s%f",&rno,name,&mark);
printf("Printing Data...\n");
printf("Roll Number=%d\n",rno);
printf("name=%s\n",name);
printf("mark=%f\n",mark);
getch();
}
---------------------------------------------------------------
Output:

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


No comments: