=> Write a program in
C to print the grade of given mark ?
Solution :
Solution :
#include<stdio.h>
#include<conio.h>
main()
{
int numb;
printf("Please Enter Your Number : ");
scanf("%d",&numb);
if(numb>=40
&& numb <=59)
printf("You
Got B : Too Bad");
else
if(numb>=60
&& numb <=69)
printf("You
Got A - : Average");
else
if(numb>=70
&& numb <=79)
printf("You
Got A : Good");
else
if(numb>=80
&& numb <=100)
printf("You
Got A + :Great");
else
if(numb>100)
printf("Invalid Number.\nPlease Maintain The Range of 1 -
100");
else
printf("You
Fail In The Exam");
getch();
}
Program Analysis :
This program will let you know a grade point inputted from terminal or user maintaining a range of 40-100 marks and if number less than 40 it will publish fail.
These are the basic program written through if else if chain.Such an easy program and by practicing these type of program learner's basic will be improve on if expression.
Post a Comment