0% found this document useful (0 votes)
25 views11 pages

EXP04

This is EEE105 post lab report

Uploaded by

meherabkhan1610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views11 pages

EXP04

This is EEE105 post lab report

Uploaded by

meherabkhan1610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Department of EEE

Post Lab Report

Course Code:EEE105
Section:01

Student Name:Md.Meherab Khan


Student Id:2023-1-80-048

Course Instructor:Muhammed Mazharul Islam


Problem:01
int main() {
int number_of_student,i,id;
double
term1,term2,finall,attendance,ct1,ct2,ct3,avg_ct,total;
char grade;

printf("Enter the number of students: ");


scanf("%d",&number_of_student);

for (i=0;i<number_of_student;i++) {
printf("\nEnter Student ID:");
scanf("%d",&id);

printf("Enter Term 1 marks (out of 20): ");


scanf("%lf",&term1);

printf("Enter Term 2 marks (out of 20): ");


scanf("%lf",&term2);

printf("Enter Final marks (out of 30): ");


scanf("%lf",&finall);

printf("Enter Attendance marks (out of 10): ");


scanf("%lf",&attendance);

printf("Enter Class Test marks (3 tests, out of 20


each):\n");
printf("Frist Class Test marks:");
scanf("%lf",&ct1);
printf("Second Class Test marks:");
scanf("%lf",&ct2);
printf("Third Class Test marks:");
scanf("%lf",&ct3);
if(ct1<=ct2 && ct1<=ct2){
avg_ct=(ct2+ct3)/2;
}
if(ct2<=ct1 && ct2<=ct3){
avg_ct=(ct1+ct3)/2;
}
if(ct3<=ct1 && ct3<=ct2){
avg_ct=(ct1+ct2)/2;
}
total = term1 + term2 + finall + attendance +
avg_ct;

if (total >= 70) grade = 'A';


else if (total >= 60) grade = 'B';
else if (total >= 50) grade = 'C';
else if (total >= 40) grade = 'D';
else grade = 'F';

printf("\nStudent ID:%d\n",id);
printf("Total Marks:%.2lf\n",total);
printf("Grade:%c\n",grade);
}
float highest=100,lowest=0;
float sum;
if (total <= highest){
printf("\nHighest Score: %0.2lf\n",total);
}
if(total >= lowest){
printf("\nLowest Score: %0.2lf\n",total);
}
sum=(total/number_of_student);

printf("Average Score: %f\n",sum);

return 0;
}
Output:
Problem:02
#include<stdio.h>
int main(){
int frist_year,second_year,Leapyear;
frist:
printf("Enter the frist year:");
scanf("%d",&frist_year);
printf("Enter the second year:");
scanf("%d",&second_year);
if (frist_year>second_year){
printf("Error!\n");
goto frist;
}
printf("Leap year between these year are:\n");

for(Leapyear=frist_year;Leapyear<=second_year;Leapyear++){
if((Leapyear%4)==0||(Leapyear%400)==0){
printf("%d\n",Leapyear);
}

return 0;
}
Output:

You might also like