User forums > Help

After built and run,the program stopped working...any idea?

(1/1)

ntamas:
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?

stahta01:
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.

Navigation

[0] Message Index

Go to full version