Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int C,CF,DM,ST,EN;
- float total,score;
- char Grade,cfG,cG,Name[10];
- clrscr();
- printf("Enter name of student: ");
- scanf("%s",&Name);
- printf("\nEnter mark of C: ");
- scanf("%d",&C);
- if(C<0 && C>100)
- printf("Re enter Mark");
- if(C>=90)
- cG='A';
- else if(C>=80 && C<=89)
- cG='B';
- else if(C>=70 && C<=79)
- cG='C';
- else if(C>=60 && C<=69)
- cG='D';
- else if(C>=50 && C<=59)
- cG='E';
- else if(C<50)
- cG='F';
- else
- printf("INVALID ENTRY");
- printf("\nEnter mark of CF: ");
- scanf("%d",&CF);
- if(CF<0 && CF>100)
- printf("CF<0 && CF>100");
- if(CF>=90)
- cfG='A';
- else if(CF>=80 && CF<=89)
- cfG='B';
- else if(CF>=70 && CF<=79)
- cfG='C';
- else if(CF>=60 && CF<=69)
- cfG='D';
- else if(CF>=50 && CF<=59)
- cfG='E';
- else if(CF<50)
- cfG='F';
- else
- printf("INVALID ENTRY");
- printf("\nEnter mark of DM: ");
- scanf("%d",&DM);
- if(DM<0 && DM>100)
- printf("Re enter Mark");
- printf("\nEnter mark of ST: ");
- scanf("%d",&ST);
- if(ST<0 && ST>100)
- printf("Re enter Mark");
- printf("\nEnter mark of EN: ");
- scanf("%d",&EN);
- if(EN<0 && EN>100)
- printf("Re enter Mark");
- total=EN+ST+DM+C+CF;
- score=total/5;
- printf("\nName of the student:%s",Name);
- printf("\nGrade of C=%c",cG);
- printf("\nGrade of CF=%c",cfG);
- if(score>=90)
- printf("\nGrade of the student= A");
- else if(score>=80 && score<=89)
- printf("\nGrade of the student= B");
- else if(score>=70 && score<=79)
- printf("\nGrade of the sudent= C");
- else if(score>=60 && score<=69)
- printf("\nGrade of the student= D");
- else if(score>=50 && score<=59)
- printf("\nGrade of the student= E");
- else if(score<50)
- printf("\nGrade of the student= F");
- else
- printf("Invalid Entry");
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment