Professional Documents
Culture Documents
University
ROLL NO.:-
R270B44
REG.ID:-
10801820
ACKNOWLED
GEMENT
No work of significance can be claimed on a
result of an individual Efforts and same
holds true further for this project as well, for
through it carries my name the energy of
many have contributed in no small measure
in completion of this project.
I am very thankful to my friend and our
teachers “MR.MUNISH KUMAR” who help
me to make this project.
INTRODUCTION TO C
LANGUAGE
C IS A PROGRAMMING LANGUAGE
DEVELOPED AT AT AND T’S BELL
LABORATRIES OF USA IN 1972.IT
WAS DESIGNED AND WRITTEN BY
DENNIS RITCHIE.IT IS A SENSITIVE
AND REDUCES THE GAP BETWEEN
LOWER AND UPPER CASE
LETTERS SO MANY
PROGRAMMERS PREFFERED C TO
OLDER LANGUAGES LIKE
FORTRAN OR PL/I,OR THE NEWER
ONES LIKE PASCAL AND APL
INTRODUCTION TO EXAMINATION
MANAGEMENT SYSTEM
SYSTEM REQUIREMENTS
#include<stdio.h>
#include<conio.h>
void main()
struct Exam
{ int r_no;
char clas[20];
char name[40];
char add[40];
char f_name[40];
float math;
float phy;
float che;
float comp;
float avg;
float avg1;
};
struct Exam f;
float avg;
int r_no;
char clas[20];
fp=fopen("EXAM.DAT","rb+");
if(fp==NULL)
fp=fopen("EXAM.DAT","wb+");
if(fp==NULL)
{
puts("Cannot open file");
exit(1);
recsize = sizeof(f);
while(1)
clrscr();
gotoxy(30,10);
gotoxy(30,12);
gotoxy(30,14);
printf("3. Topper");
gotoxy(30,16);
printf("4. Failer");
gotoxy(30,18);
gotoxy(30,20);
printf("0.Exit");
gotoxy(30,22);
printf("Your choice");
fflush(stdin);
choice = getche();
switch(choice)
case '1':
fseek(fp,0,SEEK_END);
another = 'Y';
printf("\nEnter Roll_no");
scanf("%d", &f.r_no);
printf("\nEnter Name");
scanf(" %s",f.name);
printf("\nEnter class");
scanf("%s",f.clas);
printf("\nEnter Address");
scanf("%s",f.add);
scanf("%s",f.f_name);
scanf("%f", &f.math);
scanf("%f",&f.phy);
scanf("%f",&f.che);
printf("enter computer marks");
scanf("%f",&f.comp);
f.avg=f.math+f.comp+f.phy+f.che;
f.avg1=f.avg/4;
fflush(stdin);
another = getche();
break;
case '2':
clrscr();
rewind(fp);
printf("\n%d\t%s\t%s\t%s\t%s\t%2.2f\t%2.2f\t
%2.2f\t%2.2f\t%2.2f", f.r_no,f.name,f.clas, f.add, f.f_name,
f.math,f.phy,f.che,f.comp,f.avg1);
getch();
break;
case '3':
another='Y';
avg=0.0;
while(another=='Y')
scanf("%s",clas);
rewind(fp);
if((f.avg>=avg)&&(strcmp(f.clas,clas)==0))
avg = f.avg;
fflush(stdin);
another=getche();
break;
case '4':
another='Y';
avg=33.3;
while(another=='Y')
rewind(fp);
//flag=0;
//flag=1;
//printf("\n%f",f.avg1);
if((strcmp(f.clas,clas)==0)&&(f.avg1<=avg))
printf("\n failed",f.r_no);
//getch();
//if(flag==0)
//{
// getch();
//}
fflush(stdin);
another=getche();
break;
case '5':
another='Y';
while(another=='Y')
scanf("%d",&r_no);
ft = fopen("TEMP.DAT","wb");
rewind(fp);
if(f.r_no!=r_no)
fclose(fp);
fclose(ft);
remove("EXAM.DAT");
rename("TEMP.DAT", "EXAM.DAT");
fp=fopen("EXAM.DAT", "rb+");
fflush(stdin);
another = getche();
break;
case '0':
fclose(fp);
exit();
}
Requirement Analysis:
BOOKS: LET US C
ANSIC
COMPLETE REFRENCES