Home » , » Basic C Programming Practice - Practice 11

Basic C Programming Practice - Practice 11

Written By Unknown on Thursday, October 10, 2013 | 11:40 PM

=> Write a program in C to print the grade of given mark ?




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.

Share this article :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates