Search:

Type: Posts; User: Stevan

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,525

    Thank you i understand it now. What i did as a...

    Thank you i understand it now.
    What i did as a test is printing s[i] (before i made this thread), and i was confused cause i didn't converted it to int, and still i would get numbers printed, which...
  2. Replies
    2
    Views
    1,525

    Conversion/String Problem

    I was solving Project Eular-Problem 56 ( Problem 56 - Project Euler ), its relatively easy problem.But i encountered a small issue.I was so frustrated cause i couldn't find solution, so i have to...
  3. Replies
    3
    Views
    1,514

    Hello, When you solve problems that root wrote,...

    Hello,
    When you solve problems that root wrote, i would strongly recommend to use function in this program (you also get that hint in the assignment ). I would give you a idea how do it

    ...
  4. Replies
    2
    Views
    3,602

    Hello, First thing, you didn't even initialized...

    Hello,
    First thing, you didn't even initialized one and two, cause
    int one,two,three=0 isn't equal to one=0,two=0,three=0,you just initialized three.
    While loop seems ok, i would only put some...
  5. Replies
    4
    Views
    1,275

    How did i miss that? Thank you, it works like a...

    How did i miss that? Thank you, it works like a charm :)
  6. Replies
    4
    Views
    1,275

    Thank you i did it , and also i didnt need two...

    Thank you i did it , and also i didnt need two insructions only one
    s+=mpz_tdiv_q_ui (result,result, 10);.
    And instead while i did for loop that goes from 1 to 300 (i suppose that number is not...
  7. Replies
    4
    Views
    1,275

    Problem with GMP

    Hello guys, i am trying to solve Project eular problem-20 :"Find the sum of the digits in the number 100!".So i downloaded and included gmp libary for big integer.This is my code:


    #include...
  8. Thread: Switch problem

    by Stevan
    Replies
    4
    Views
    1,097

    You could also change opt_no to char, cause '1' ...

    You could also change opt_no to char, cause '1' is type char.
  9. Replies
    7
    Views
    1,019

    No need to use a pointer here, just declare a as...

    No need to use a pointer here, just declare a as array, with some max size that you want.
  10. Thread: Switch problem

    by Stevan
    Replies
    4
    Views
    1,097

    scanf("%d", &opt_no); Instead of scanf use...

    scanf("%d", &opt_no);

    Instead of scanf use getchar.


    opt_no=getchar();

    And switch statement will work.
  11. @abhishekcoder...

    @abhishekcoder, which term, 1/0! ?
  12. float sum=1.0,fact=1.0; Your sum should be equal...

    float sum=1.0,fact=1.0;
    Your sum should be equal to 0 not 1, cause you are not multiplying sum, you are adding.
  13. Thread: Array Problem

    by Stevan
    Replies
    9
    Views
    1,152

    I solved it finally here is the code: ...

    I solved it finally here is the code:


    for(i=0;i<n;i++)
    {
    b=1;
    for(c=0;c<n;c++)
    {
    if(i%prb[c]==0)
    {
  14. Thread: Array Problem

    by Stevan
    Replies
    9
    Views
    1,152

    Thank you guys! Quzah, what do you mean by "You...

    Thank you guys!
    Quzah, what do you mean by "You also never actually initialize prb"?
    I have to say i just started working with arrays, so i realized it like this, there will be max slots, and in...
  15. Thread: Array Problem

    by Stevan
    Replies
    9
    Views
    1,152

    Ok, but still i dont know how to do this: ...

    Ok, but still i dont know how to do this:


    if(i%prb[0] && i%prb[1] && i%prb[2]..... i%prb[q])

    Easy way, with loop.
  16. Thread: Array Problem

    by Stevan
    Replies
    9
    Views
    1,152

    Array Problem

    Hello guys,i have, a problem with my array and i hope you guys can help me solve it. So i have assignment to print out number which are multiplied by prime number 2,3 and 7, and no other prime...
Results 1 to 16 of 17