#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#define N 2
struct Student{
char student_name[20];
int Reg_no,First_lang,Second_lang,Maths,Phy,Che,Bio,Total,Result;
int Engg_cutoff,Medi_cutoff;
float Average;
};
int main(){
struct Student *stuRecord;
char tempName[20];
int tempTotal = 0,flag = 0,foundIndex,getAction,i,j;
clrscr();
stuRecord = (struct Student*)malloc(N*sizeof(struct Student));
for(i=0;i<N;i++){
printf("\n %d.Name :",(i+1));
scanf("%s",&stuRecord[i].student_name);
printf("\n Register Number :");
scanf("%d",&stuRecord[i].Reg_no);
printf("\n First Language :");
scanf("%d",&stuRecord[i].First_lang);
printf("\n Second Language :");
scanf("%d",&stuRecord[i].Second_lang);
printf("\n Maths :");
scanf("%d",&stuRecord[i].Maths);
printf("\n Physics :");
scanf("%d",&stuRecord[i].Phy);
printf("\n Chemistry :");
scanf("%d",&stuRecord[i].Che);
printf("\n Biology :");
scanf("%d",&stuRecord[i].Bio);
tempTotal=0;
tempTotal = stuRecord[i].First_lang+stuRecord[i].Second_lang+stuRecord[i].Maths+stuRecord[i].Phy+stuRecord[i].Che+stuRecord[i].Bio;
stuRecord[i].Total = tempTotal;
stuRecord[i].Average = tempTotal/6;
if(stuRecord[i].First_lang < 50 ||
stuRecord[i].Second_lang < 50 ||
stuRecord[i].Maths < 50 ||
stuRecord[i].Phy < 50 ||
stuRecord[i].Che < 50 ||
stuRecord[i].Bio < 50)
{
stuRecord[i].Result = 0;
}
else{
stuRecord[i].Result = 1;
stuRecord[i].Medi_cutoff = stuRecord[i].Bio+(stuRecord[i].Phy/2)+(stuRecord[i].Che/2);
stuRecord[i].Engg_cutoff = stuRecord[i].Maths+(stuRecord[i].Phy/2)+(stuRecord[i].Che/2);
}
}
printf("\n Enter the Name to be Searched: ");
scanf("%s",&tempName);
for(i=0;i<N;i++){
if(strcmp(tempName,stuRecord[i].student_name)==0)
{
foundIndex = i;
flag = 1;
break;
}
}
if(flag == 0)
{
printf("Details Not Found");
}
else
{
printf( "Press 1 to Print Result: \n" );
printf( "Press 2 to Print Cut Off Marks: \n" );
scanf( "%d", &getAction );
switch (getAction) {
case 1:
printf("\n Mark of %s are given below... \n",tempName);
printf("\n Register No: %d",stuRecord[foundIndex].Reg_no);
printf("\n First Language: %d",stuRecord[foundIndex].First_lang);
printf("\n Second Language: %d",stuRecord[foundIndex].Second_lang);
printf("\n Maths: %d",stuRecord[foundIndex].Maths);
printf("\n Physics: %d",stuRecord[foundIndex].Phy);
printf("\n Chemistry: %d",stuRecord[foundIndex].Che);
printf("\n Biology: %d",stuRecord[foundIndex].Bio);
printf("\n Total: %d",stuRecord[foundIndex].Total);
printf("\n Average: %f",stuRecord[foundIndex].Average);
if(stuRecord[foundIndex].Result == 1)
{
printf("\n Result: Pass \n");
}
else
{
printf("\n Result: Fail \n");
}
break;
case 2:
printf("\n Mark of %s are given below... \n",tempName);
printf("\n Register No: %d",stuRecord[foundIndex].Reg_no);
printf("\n Total: %d",stuRecord[foundIndex].Total);
if(stuRecord[foundIndex].Result == 1)
{
printf("\n Result: Pass \n");
if(stuRecord[foundIndex].Medi_cutoff >=175){
printf("\n Medical_CutOff: Eligible \n");
printf("\n Engg_CutOff: Eligible \n");
}
else if(stuRecord[foundIndex].Engg_cutoff >=150){
printf("\n Medical_CutOff: Not Eligible \n");
printf("\n Engg_CutOff: Eligible \n");
}
else{
printf("\n Medical_CutOff: Not Eligible \n");
printf("\n Engg_CutOff: Not Eligible \n");
}
}
else
{
printf("\n Result: Fail \n");
printf("\n Medical_CutOff: Not Eligible \n");
printf("\n Engg_CutOff: Not Eligible \n");
}
break;
default:
printf("Sorry, You Have Chosen Wrongly \n");
break;
}
}
getch();
return 0;
}
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#define N 2
struct Student{
char student_name[20];
int Reg_no,First_lang,Second_lang,Maths,Phy,Che,Bio,Total,Result;
int Engg_cutoff,Medi_cutoff;
float Average;
};
int main(){
struct Student *stuRecord;
char tempName[20];
int tempTotal = 0,flag = 0,foundIndex,getAction,i,j;
clrscr();
stuRecord = (struct Student*)malloc(N*sizeof(struct Student));
for(i=0;i<N;i++){
printf("\n %d.Name :",(i+1));
scanf("%s",&stuRecord[i].student_name);
printf("\n Register Number :");
scanf("%d",&stuRecord[i].Reg_no);
printf("\n First Language :");
scanf("%d",&stuRecord[i].First_lang);
printf("\n Second Language :");
scanf("%d",&stuRecord[i].Second_lang);
printf("\n Maths :");
scanf("%d",&stuRecord[i].Maths);
printf("\n Physics :");
scanf("%d",&stuRecord[i].Phy);
printf("\n Chemistry :");
scanf("%d",&stuRecord[i].Che);
printf("\n Biology :");
scanf("%d",&stuRecord[i].Bio);
tempTotal=0;
tempTotal = stuRecord[i].First_lang+stuRecord[i].Second_lang+stuRecord[i].Maths+stuRecord[i].Phy+stuRecord[i].Che+stuRecord[i].Bio;
stuRecord[i].Total = tempTotal;
stuRecord[i].Average = tempTotal/6;
if(stuRecord[i].First_lang < 50 ||
stuRecord[i].Second_lang < 50 ||
stuRecord[i].Maths < 50 ||
stuRecord[i].Phy < 50 ||
stuRecord[i].Che < 50 ||
stuRecord[i].Bio < 50)
{
stuRecord[i].Result = 0;
}
else{
stuRecord[i].Result = 1;
stuRecord[i].Medi_cutoff = stuRecord[i].Bio+(stuRecord[i].Phy/2)+(stuRecord[i].Che/2);
stuRecord[i].Engg_cutoff = stuRecord[i].Maths+(stuRecord[i].Phy/2)+(stuRecord[i].Che/2);
}
}
printf("\n Enter the Name to be Searched: ");
scanf("%s",&tempName);
for(i=0;i<N;i++){
if(strcmp(tempName,stuRecord[i].student_name)==0)
{
foundIndex = i;
flag = 1;
break;
}
}
if(flag == 0)
{
printf("Details Not Found");
}
else
{
printf( "Press 1 to Print Result: \n" );
printf( "Press 2 to Print Cut Off Marks: \n" );
scanf( "%d", &getAction );
switch (getAction) {
case 1:
printf("\n Mark of %s are given below... \n",tempName);
printf("\n Register No: %d",stuRecord[foundIndex].Reg_no);
printf("\n First Language: %d",stuRecord[foundIndex].First_lang);
printf("\n Second Language: %d",stuRecord[foundIndex].Second_lang);
printf("\n Maths: %d",stuRecord[foundIndex].Maths);
printf("\n Physics: %d",stuRecord[foundIndex].Phy);
printf("\n Chemistry: %d",stuRecord[foundIndex].Che);
printf("\n Biology: %d",stuRecord[foundIndex].Bio);
printf("\n Total: %d",stuRecord[foundIndex].Total);
printf("\n Average: %f",stuRecord[foundIndex].Average);
if(stuRecord[foundIndex].Result == 1)
{
printf("\n Result: Pass \n");
}
else
{
printf("\n Result: Fail \n");
}
break;
case 2:
printf("\n Mark of %s are given below... \n",tempName);
printf("\n Register No: %d",stuRecord[foundIndex].Reg_no);
printf("\n Total: %d",stuRecord[foundIndex].Total);
if(stuRecord[foundIndex].Result == 1)
{
printf("\n Result: Pass \n");
if(stuRecord[foundIndex].Medi_cutoff >=175){
printf("\n Medical_CutOff: Eligible \n");
printf("\n Engg_CutOff: Eligible \n");
}
else if(stuRecord[foundIndex].Engg_cutoff >=150){
printf("\n Medical_CutOff: Not Eligible \n");
printf("\n Engg_CutOff: Eligible \n");
}
else{
printf("\n Medical_CutOff: Not Eligible \n");
printf("\n Engg_CutOff: Not Eligible \n");
}
}
else
{
printf("\n Result: Fail \n");
printf("\n Medical_CutOff: Not Eligible \n");
printf("\n Engg_CutOff: Not Eligible \n");
}
break;
default:
printf("Sorry, You Have Chosen Wrongly \n");
break;
}
}
getch();
return 0;
}
No comments:
Post a Comment