Search & Find out

Sunday, December 6, 2009

Accepting percentage & print pass or fail


#include "iostream.h"
#include "conio.h"

 class per
 {
 public:
 int a;
 };
void main()

{
  clrscr();
per r;
cout<<"Enter the percentage of a student: ";
cin>>r.a;
if(r.a<0||r.a>100)

cout<<"you entered an invalid input";
else if(r.a<40)
cout<<"The student is failed\n";
else
cout<<"The student is passed\n" ;

getch();
}



Get the executable ( .exe ) file for this program..
Download

0 comments:

Post a Comment

 

My Blog List

Term of Use