Sunday, 16 October 2016

HHW Q24. WAP to calculate grade from the sslab given .

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a;
int c;
char b,A,B,C,D,E;
cout<<"Enter your CGPA ";
cin>>a;
b=a>8.0?'A':(a>6.5?'B':(a>5.0?'C':(a>3.5?'D':'E')));
cout<<"Your grade is "<<b;
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...