Powered By Blogger

Monday, May 4, 2009

C Programming

#include
#include
void main()
{
clrscr();
FILE *fp;
char *name,*roll,*gpa;
int i;
fp=fopen("c:\\information.dau","w");
for(i=0;i<2;i++)
{
printf("Enter the information of student number[%d]",i+1);
gets(name);gets(roll);gets(gpa);
fprintf(fp,"%20s %20s %5s\n",name,roll,gpa);
}
fclose(fp);
fp=fopen("c:\\information.dau","r");
while((fscanf(fp,"%20s %20s %5s",name,roll,gpa))!=EOF)
{
printf("%20s %20s %5s\n",name,roll,gpa);
}
fclose(fp);
getch();
}


0 comments:

About This Blog

This is an important blog about updated news about computer science and technology.

Blog Archive

Visitors

  © Free Blogger Templates Blogger Theme II by Ourblogtemplates.com 2008

Back to TOP