#include <stdio.h>
int main(){
int total_ch=0;
int total_courses=0;
float sum=0.0;
float gpa=0.0;
printf("Enter total number of courses: \n);
scanf(" %d",&total_courses);
for(int i=0;i < total_courses; i++){
char course[10];
int marks=0;
int ch=0;
float cgpa=0.0;
printf("Enter the course name: \n");
scanf(" %s",&course);
printf("Enter the credit hours of the course\n");
scanf(" %d",&ch);
printf("Enter the marks of the course\n");
scanf(" %d",&marks);
total_ch += ch;
if (marks > 85){
printf("Your Cgpa of %s is 4.00 and your grade is A\n",&course);
sum+=(ch*4.00);
}else if (marks > 79 && marks < 86 ){
printf("Your Cgpa of %s is 3.67 and your grade is A-\n",&course);
sum+=(ch*3.67);
}else if (marks > 75 && marks < 80){
printf("Your Cgpa of %s is 3.33 and your grade is B+\n",&course);
sum+=(ch*3.33);
}else if (marks > 71 && marks < 76){
printf("Your Cgpa of %s is 3.00 and your grade is B\n",&course);
sum+=(ch*3.00);
}else if (marks > 67 && marks < 72){
printf("Your Cgpa of %s is 2.67 and your grade is B-\n",&course);
sum+=(ch*2.67);
}else if (marks > 63 && marks < 68){
printf("Your Cgpa of %s is 2.50 and your grade is C+\n",&course);
sum+=(ch*2.50);
}else if (marks > 59 && marks < 64){
printf("Your Cgpa of %s is 2.00 and your grade is C\n",&course);
sum+=(ch*2.00);
}else if (marks > 56 && marks < 60){
printf("Your Cgpa of %s is 1.67 and your grade is C-\n",&course);
sum+=(ch*1.67);
}else if (marks > 53 && marks < 57){
printf("Your Cgpa of %s is 1.33 and your grade is D+\n",&course);
sum+=(ch*1.33);
}else if (marks > 49 && marks < 54){
printf("Your Cgpa of %s is 1.00 and your grade is D\n",&course);
sum+=(ch*1.00);
}else if (marks < 50){
printf("Your Cgpa of %s is 0.00 and your grade is F\n",&course);
sum+=(ch*0.0);
}
}
gpa=sum/total_ch;
printf("Your total GPA of this semester is %f",gpa);
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}