728x90 AdSpace

Latest Article

Write a program read marks print letter grade in C C++ Example Code




Write a program print grade   in C C++ Example Code  Programming Language Write a program to print grade of a student in C ?Write a program that will read marks and print letter grades A B C D, F




//Program to Print Grade
#include<stdio.h>
#include<conio.h>
void main(void)
{
float marks=0;
clrscr();
printf("Enter grade :");
scanf("%d",&marks);
if(marks>=90 && marks<=100)
printf("\nYour grade is A");
else if(marks>=79.5 && marks <90)
printf("\nYour grade is B+");
else if(marks>=75.5 && marks <79.5)
printf("\nYour grade is B");
else if(marks>=70.5 && marks <75.5)
printf("\nYour grade is B-");
else if(marks>=65.5 && marks <70.5)
printf("\nYour grade is C+");
else if(marks>=60.5 && marks <65.5)
printf("\nYour grade is C");
else if(marks>=50.5 && marks <60.5)
printf("\nYour grade is C-");
else if(marks>=0.00 && marks <50.5)
printf("\nYour grade is D");
else
printf("\nInvalid Input...");
getch();
printf("\n\nPress any key to terminate...");
return(0);
}
no image
  • Title : Write a program read marks print letter grade in C C++ Example Code
  • Posted by :
  • Date : 07:41
  • Labels :





  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment

Top