# strange numbers?

This is a discussion on strange numbers? within the C++ Programming forums, part of the General Programming Boards category; Code: #include<iostream> #include<cstdlib> int qualityPoints(int); // prototype int main() { int average; // declare variable cout<< "Enter your average"; // ...

1. ## strange numbers?

Code:
```#include<iostream>
#include<cstdlib>
int qualityPoints(int);	// prototype
int main()
{
int average;	// declare variable
cout<< "Enter your average";	// prompt the user for input
cin>> average;	// get input
cout<< qualityPoints(average);
system("PAUSE");
return 0;
}
int qualityPoints(int value)	// definition
{
if(value>89 && value<101)
return 4;
else if(value>79 && value<90)
return 3;
else if(value>69 && value<80)
return 2;
else if(value>59 && value<70)
return 1;
else if(value<60 && value>0)
return 0; else cout<< "Enter within limit";
}```
when I type 101 or higher it gives me 'Enter within limit' + some numbers. What are these numbers? I think there is some problem in loops. I don't know exactly.

2. Code:
```int qualityPoints(int value)	// definition
{
if(value>89 && value<101)
return 4;
else if(value>79 && value<90)
return 3;
else if(value>69 && value<80)
return 2;
else if(value>59 && value<70)
return 1;
else if(value<60 && value>0)
return 0;
else{
cout<< "Enter within limit";
return -1; //here,if you input a higher number, the function returns -1
}
}```
Regards

3. Thanku v m. So nice of u.