Thursday

Write a program to enter name, roll-number and marks of 10 students and store them in a file.

# winclude<stdio.h>
#include<conio.h>
struct
 {
  int roll;
  char name[25];
  float mark;
  }std;
void main()
{
  int i;
  FILE *fp;
  fp=fopen("d:\\cprg\student.txt","wb");
  clrscr();
  printf("enter student roll number name and marks for 10 students");
  for(i=0;i<10;i++)
  {
 scanf("%d%s%f",&std.roll,std.name,&std.mark);
  fwrite(&std,sizeof(std),1,fp);
  }
  fclose(fp);

  getch();
  }

1 comment:

  1. Sir computer ko 9 n 10 class ko note maile vetayana plz help me sir

    ReplyDelete

Rahul-Notes