The document contains code that takes a student's marks as input and uses if/else statements to determine the GPA awarded based on the marks. It prints the GPA and allows the user to repeat by entering 's'. The code takes the marks as input, evaluates it using multiple conditions to check if it is within certain marks ranges, and prints the corresponding GPA. It also has a provision to print an error message if invalid marks are entered.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
54 views2 pages
#Include Int Int Char Do
The document contains code that takes a student's marks as input and uses if/else statements to determine the GPA awarded based on the marks. It prints the GPA and allows the user to repeat by entering 's'. The code takes the marks as input, evaluates it using multiple conditions to check if it is within certain marks ranges, and prints the corresponding GPA. It also has a provision to print an error message if invalid marks are entered.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
#include<stdio.
h> int main() { int marks; char y; do {
printf("Enter the marks of student\n");
scanf_s("%d", &marks);
if (marks >= 90 && marks <= 100)
{ printf("The student has been awarded with 4 GPA\n"); } else if (marks >= 86 && marks <= 89) { printf("The student has been awarded with 3.67 GPA\n"); } else if (marks >= 81 && marks <= 85) { printf("The student has been awarded with 3.33 GPA\n"); } else if (marks >= 77 && marks <= 80) { printf("The student has been awarded with 3 GPA\n"); } else if (marks >= 72 && marks <= 76) { printf("The student has been awarded with 2.67 GPA\n"); } else if (marks >= 68 && marks <= 71) { printf("The student has been awarded with 2.33 GPA\n"); } else if (marks >= 63 && marks <= 67) { printf("The student has been awarded with 2 GPA\n"); } else if (marks >= 58 && marks <= 62) { printf("The student has been awarded with 1.67 GPA\n"); } else if (marks >= 54 && marks <= 57) { printf("The student has been awarded with 1.33 GPA\n"); } else if (marks >= 50 && marks <= 53) { printf("The student has been awarded with 1 GPA\n"); } else if (marks >= 0 && marks<50) { printf("The student has been awarded with 0.0 GPA\n"); } else { printf("The User has entered Invalid marks\n"); } printf("enter s to repeat\n");