I couldn't understood the purpose of the bold part in the quotes post. I understand you were trying to warn about something but couldn't get it. Please shed some light on it.
I was replying to manasij7479 telling him that you had not initialized your variables and you were using an uninitialized variable.
The following two variables are not initialized.
To initialize these variables assign a value to them.
Code:
int RN = -1;
float M = 0.0;
You should always initialize your variables when you define them.
In the following code:
Code:
{
if ( RN >= 10000 )
break;
}
I don't think you understand the brace placement. In this snippet you are creating a block around the if statement which is not required. You probably want the braces to belong to the if statement.
Code:
if ( RN >= 10000 )
{
break;
}
You probably want to move this code to right after the cin >> RN; line.
Jim