Thursday, October 13, 2011

IF Statement(Grade)

Write a program that will input a student's grade and will display
"Congratulations you PASSED!" if the student's grade is greater than or equal 60. Otherwise "Sorry you FAILED!".
 
#include<stdio.h>
#include<conio.h>
#define p printf
#define s scanf
int GRADE;
int main( )
{


    p("Enter Grade of Student:");
    s("%d",&GRADE);
    if(GRADE >= 60)
    p("Congratulations you PASSED!");
    else
    p("Sorry you FAILED!");
    getch();
    return 0;
}

0 comments:

Post a Comment