Author Topic: After built and run,the program stopped working...any idea?  (Read 9392 times)

ntamas

  • Guest
After built and run,the program stopped working...any idea?
« on: September 18, 2014, 11:32:57 pm »
so after I clicked on 'build and run',the program starts to work,but after inserting 2 numbers and hitting enter,the program stops working...

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,f,e,c,d;
    printf("Insert two numbers.\n");
    scanf("%d,%d",&a,&b);

    if ((b=0)&&(b=1))
     {

      printf("No solution.\n");
     }
    else
        {
         c=(4*b);
         d=c+7*(2*a-1);
         e=b*(b-1);
         f=d/e;

         printf("x=%d",f);
         scanf("%d",f);

        }

}

any idea?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: After built and run,the program stopped working...any idea?
« Reply #1 on: September 19, 2014, 12:04:36 am »
I have the idea that you did NOT read the rules.

http://forums.codeblocks.org/index.php/topic,9996.0.html

Edit: Your code is broken dividing by zero can cause many this to happen.

Tim S.
« Last Edit: September 19, 2014, 12:36:57 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org