answersLogoWhite

0


Best Answer

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int marks;

cout<<"Enter Marks of Student=";

cin>>marks;

cout<<"Grade\n";

if(marks>0 && marks<50)

cout<<"F";

else if(marks>=50 && marks<55)

cout<<"C-";

else if(marks>=55 && marks<60)

cout<<"C";

else if(marks>=60 && marks<65)

cout<<"c+";

else of(marks>=65 && marks<69)

cout<<"B-";

else if(marks>=69 && marks<71)

cout<<"B";

else if(marks>=71 && marks<75)

cout<<"B+";

else if(marks>=75 && marks<79)

cout<<"B";

else if(marks>=79 && marks<84)

cout<<"A";

else

cout<<"A";

getch();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to print grade of a student in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a unix program to print print a pattern?

echo 'print a pattern'


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


How do you write a program in qbasic to input marks of 10 students in 5 subjects and display the average of each students?

DIM grade(6), lowGrade(5), testName$(6), seq$(6) seq$(1) = "first " seq$(2) = "second" seq$(3) = "third " seq$(4) = "fourth" seq$(5) = "fifth " grLetter$ = "ABCD" begin: COLOR 7, 0 CLS PRINT "Test averaging program" PRINT "======================" PRINT PRINT "Lets enter some basic info before we get started .." PRINT FOR ix% = 1 TO 4 PRINT "enter a number (1-100) that you consider to be the lowest "; MID$(grLetter$, ix%, 1); INPUT lowGrade(ix%) PRINT STRING$(78, "-") NEXT ix% enterTests: COLOR 7, 0 CLS LINE INPUT "Enter student name or / to end program: "; name$ IF name$ = "/" THEN CLS END END IF LINE INPUT "Enter student age : "; age$ age% = VAL(age$) PRINT STRING$(78, "=") FOR ix% = 1 TO 5 PRINT "Enter the subject name for the "; seq$(ix%); " test: "; LINE INPUT testName$(ix%) LINE INPUT "Enter the grade for this test (1-100): "; grade$ grade(ix%) = VAL(grade$) PRINT STRING$(78, "-") NEXT ix% CLS displayReport: COLOR 7, 0 CLS GOSUB computeAverage PRINT "Test Average Report for "; name$ PRINT PRINT "Age is "; age$ IF (age% &gt;= 25) = 0 THEN COLOR 6, 0 PRINT " ** Student is underage **" END IF COLOR 7, 0 stuGrade = average GOSUB determineAthruF PRINT "Test average is"; PRINT USING "###.##"; average PRINT "This is a grade of "; grade$ IF grade$ = "F" THEN COLOR 4, 0 PRINT "** Student did not pass **" END IF COLOR 7, 0 PRINT PRINT "Test Summary (those in "; COLOR 4, 0 PRINT "red"; COLOR 7, 0 PRINT " are failing)" PRINT FOR ix% = 1 TO 5 COLOR 7, 0 stuGrade = grade(ix%) GOSUB determineAthruF rptName$ = SPACE$(25) MID$(rptName$, 1) = testName$(ix%) IF grade$ = "F" THEN COLOR 4, 0 END IF PRINT rptName$, grade$, PRINT USING "###.##"; stuGrade NEXT ix% COLOR 7, 0 PRINT LINE INPUT "Do you wish to average another student (Y/N) "; yn$ yn$ = UCASE$(yn$) IF yn$ = "Y" THEN GOTO enterTests END IF END computeAverage: total = 0 FOR ix% = 1 TO 5 total = total + grade(ix%) NEXT ix% average = total / 5 RETURN determineAthruF: IF stuGrade &gt;= lowGrade(4) THEN grade$ = "D" IF stuGrade &gt;= lowGrade(3) THEN grade$ = "C" IF stuGrade &gt;= lowGrade(2) THEN grade$ = "B" IF stuGrade &gt;= lowGrade(1) THEN grade$ = "A" END IF END IF END IF ELSE grade$ = "F" END IF RETURN


Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


Write a c program to print roman letters?

good morning


Can you Write a program in 'c' to print symbols of playing cards?

Yes.


Write a program to print the sum of a sparse matrix?

This is a directive, not a question.


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i &lt;= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


Write c program to print?

include &lt;stdio.h&gt; int main (void) { puts ("print"); return 0; }


How can you write in cursive?

You usally learn cursive in 3rd grade, and you get print-offs on google.


How do make 10student name and his remarks in q-basic?

' '*** PROGRAM: Collecting student data: names/marks. ' '*** Create 2 array variables to store each students name/marks... DIM students$(10), marks$(10) '*** SCREEN ONE/Collect the data... CLS '...(CL)ear the Output (S)creen '*** print heading... PRINT "PROGRAM: Collecting each student names/marks..." PRINT '*** A FOR/NEXT loop is used to collect each individual students data... FOR eachStudentNo% = 1 TO 10 '*** Get each students names/marks 'by typing these values in from the keyboard.... PRINT eachStudentNo%; "&gt;" INPUT " Enter student name"; students$(eachStudentNo%) INPUT "Enter student marks"; marks$(eachStudentNo%) NEXT '*** SCREEN TWO: Output the collected data... CLS '...(CL)ear the Output (S)creen '*** Print headings... PRINT "Student No.", "Student Name", "Student Marks" PRINT '*** FOR/NEXT loop is used to print out the 2 array student 'name/marks' values... FOR eachStudentNo% = 1 TO 10 '*** print out each students 'number/name/mark' values... PRINT eachStudentNo%, PRINT students$(eachStudentNo%), PRINT marks$(eachStudentNo%) NEXT END '...END of program/halt program code execution