User forums > Help

Problems compiling

(1/1)

jlb:
Hi guys. I'm starting to use Codeblocks and I have a little problem... When I run my projects ( in C) I have no errors nor warnings. The window with the compiled program comes up, I can type all the data, numbers or words the program needs, but once I press enter to get an answer, it gets stucked and does nothing. For examle, I make a program to multiply two numbers, when I run it I can type those two numbers but when I press enter to get the result nothing happens. I don't know what this could be. It'd be of much help if you could give me a hand. Thanx.

stahta01:
I suggest you post your code on a site like http://cboard.cprogramming.com/forum.php

Because your problem sounds like a coding issues and NOT a Code::Blocks issue.

They will likely want a full re-build log see http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

If you think it is NOT a coding issue please post the full re-build log in this thread and maybe I or someone else will see an error.

Tim S.

jlb:

--- Code: ---#include <stdio.h>
#include <conio.h>

void div(int a, int b)
{
    int i,result=0,rest=0,p;
    for(i=1;i=a;i++)
        if((i*b)<a)
        result=i;
    else



        p=result*b;
        rest=a-p;

        printf("The quotient is %d and the reminder is %d",result,rest);

        return;
}


int main()
{
    int a,b;

    printf("Please type the dividend: \n");
    scanf("%d",&a);
    printf("Now, type the divisor. REMEMBER TO CHOOSE A SMALLER NUMBER: \n");
    scanf("%d",&b);

    div(a,b);

    return 0;

}
 
--- End code ---


Here it is. To be honest I really thought the code was ok, because every time it was wrong the project didn run at all. Sorry to bother

stahta01:
Please post the requested full rebuild log; please reads the rules before you get banned!

Edit: Link to rules http://forums.codeblocks.org/index.php/topic,9996.0.html

Tim S.

stahta01:
Looks like bad code; we do NOT help people with bad code on this site.

Tim S.

Navigation

[0] Message Index

Go to full version