crash - Where is the Error in my C++ code? -
here error screenshot: http://prntscr.com/9n6ybt
here code:
#include <iostream> using namespace std; int main() { int a, b; cin>>a>>b; for(int i=a;i<=b;i++) { if (b%i==0) { cout << << " "; } } return 0; }
you not handling case might 0 (division 0) b % indetermined. can solve going way:
if (i==0) continue;
Comments
Post a Comment