#include #include //function main begins program executionint main(int argc, char *argv[]){ //array of marks double marks[10]; //prompt user to enter marks for(int i=0;i<10;i++){ printf("Enter mark %d [2.75-4]: ",(i+1));//show our text Hello world scanf("%lf",&marks[i]); } double sum=0; //calculate sum of 10 subjects for(int i=0;i<10;i++){ sum+=marks[i]; } double CGPA=sum/10; //check if CGPA is Excellence if(CGPA==4){ printf("Excellence\n"); } //check if CGPA is Promising if(CGPA>=3.50 && CGPA<= 3.99){ printf("Promising\n"); } //check if CGPA is Very good if(CGPA>= 2.75 && CGPA<= 3.499){ printf("Very good\n"); } //check if CGPA is Satisfactory if(CGPA< 2.75){ printf("Satisfactory\n"); } //delay system("PAUSE"); return 0;//indicate that program ended successfully}
Comments