see

A

WAP to take the percentage marks of a student as input and find which division the student falls into using switch statement.


WAP to take the percentage marks of a student as input and find which division the student falls into using switch statement.
#include<stdio.h>
#include<conio.h>
void main()
{
 int i,j;
 clrscr();
 printf("Enter the Percentage ");
 scanf("%d",&i);
 if(i>=90 && i<=100)
 j=1;
 else if(i<90 && i>=70)
 j=2;
 else if(i<70 && i>=60)
 j=3;
 else if(i<60 && i>=45)
 j=4;
 else if(i<45 && i>=35)
 j=5;
 else if(i<35 && i>=0)
 j=6;
 switch(j)
   {
     case 1:printf("Division A");
     break;
     case 2:printf("Division B");
     break;
     case 3:printf("Division C");
     break;
     case 4:printf("Division D");
     break;
     case 5:printf("Division E");
     break;
     case 6:printf("Division F");
     break;
     default:printf("Wrong input");
   }
 getch();
}

Copyright © 2013. BloggerSpice.com - All Rights Reserved
Customized by: MohammadFazle Rabbi | Powered by: BS
Designed by: Tilabs