Thursday, August 4, 2011

Masterpiece

As a beginner IT programmer, I want to develop simple programs.

This is a sample program using Dev C++:

Write a program that evaluates a grade given this condition:
70-75-Print"YOU GOT C"
76-80-PRINT"YOU GOT B-"
81-85-"YOU GOT B"
86-90-"YOU GOT A-"
91-95-"YOU GOT A"
<70-PRINT"YOU GOT A FAILING MARK" >100 OR <0-PRINT "GRADE INVALID" CODES: #include
#include
Int main()
{
Int a=0
Clrscr();
Printf("Grade:");
Scanf("%i",&a);
If(!(A>100||<0)) If(a>=96)
Printf("You Got A");
Else if(a>=91)
Printf("You Got A-);
Else if(a>=86)
Printf("You Got B+");
Else if(a>=81)
Printf("You Got B");
Else if(a>=76)
Printf("You Got B-");
Else if(a>=70)
Printf("You Got C");
Else
Printf("You Got a Failing Mark");
Else
Printf("grade invalid");
Getch();
Return 0;
}

OUTPUT:

Grade:73
You Got C!

Grade:82
You Got B!