http://prntscr.com/dw254o This link is basically my assignment that I'm having trouble with. It's not even a long or complicated source code to write. But I'm not getting the correct answer. The program does run but if I input 'r' as 3 for example, I'll always get "The number 1 is the first number bigger than 3." The source code is below. Thank you!
#include <iostream>
using namespace std;
int main(){
int r, n=1, i=2;
cout<<"Input a number for variable 'r': "<<endl;
cin>>r;
while(r<=n)
{
n+=(1/i);
i++;
}
cout<<"The number "<<n<<" is the first number bigger than "<<r<<"."<<endl;