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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -