Forcing positive integer
I'm having abit of difficulty moving from programming in pascal to c++.
there was a built in function in pascal that would be say a=MOD(a) and that would automatically square and then square root the number to give me the positive back, whether or not the initial value of a was positive or negative.
there must be a function in c++ that does this =S just can't find it.
I'm using the standard stdio.h and math.h headers.
thanks
edit: i'm also having trouble with my while condition =/
printf("Please enter the annual interest rate for the mortgage\n");
scanf("%f", &i);
while (i>=100); {
printf("Invalid amount of interest. Interest can only be between 0-100%.\n");
printf("Please re-enter amount for interest\n");
scanf("%f", &i);}
no matter what value of i for interest i enter into my console program, it enters the while statement =(

