Search:

Type: Posts; User: blackgold>>

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,094

    Is it ok to have if else in my switch?

    I'm trying to compile my code and i cannot see anything wrong with it as it compiled grand before i added the if and else statements to my program.

    c:\docume~1\blackg~1\desktop\untitl~2.cpp: In...
  2. Replies
    1
    Views
    1,485

    different values in while using enum?

    Hi.
    I was wondering is there anyway i can put in different value into my while structure so i don't have to make more switches?
    Thanks alot.

    p.s. my user defined types in the enum i was thinking...
  3. Replies
    8
    Views
    3,905

    Guys thanks so much for all your help and...

    Guys thanks so much for all your help and pathencie i'm able now to understand it all.

    Is this ok




    long fibonacci( long n )
    {
    if ( n == 0 || n == 1 ) // base case
  4. Replies
    8
    Views
    3,905

    Hmm i understand what your saying guys but. I...

    Hmm i understand what your saying guys but.
    I have no idea why it would give me this,(5) when it has no idea how it is getting these numbers?
    All my program knows is to take 1 away from an integer...
  5. Replies
    8
    Views
    3,905

    I understand recursion (the basics so far so as...

    I understand recursion (the basics so far so as factorials) but in my book it says this

    the fibonacci series

    0,1,1,2,3,5,8,13,21


    begins with 0 and 1 and has the property that each...
  6. Replies
    8
    Views
    3,905

    febonacci numbers?

    // recursive fibonacci function
    #include <iostream>
    using namespace std;

    long fibonacci ( long );

    int main()
    {
    long result, number;
  7. Guys thank you so much i understand now how this...

    Guys thank you so much i understand now how this works.
    Thanks alot !
  8. recurive function cannot understand one line plz have a look

    //recursive factorial function
    #include <iostream>
    #include <iomanip>
    using namespace std;

    unsigned long factorial( unsigned long );

    int main()
    {
  9. Replies
    12
    Views
    1,433

    That code is oozing quality. Thanks alot i...

    That code is oozing quality.
    Thanks alot i understand it now for the modulas operator.
    Cya.:)
  10. Thread: enum

    by blackgold>>
    Replies
    2
    Views
    944

    I just learned the basics of that a few days ago....

    I just learned the basics of that a few days ago.
    So.



    enum Months { JAN = 1, FEB, MAR, APRIL, MAY, JUNE, JULY, AUG, SEPT, OCT, NOV, DEC, }



    Usually the values of the integer constants...
  11. Replies
    12
    Views
    2,007

    Ok thanks alot ,old folks :)

    Ok thanks alot ,old folks :)
  12. Replies
    12
    Views
    1,433

    I'm sorry , but it has to be done with alot less...

    I'm sorry , but it has to be done with alot less c++ knowledge using if if/else - + / % only as it is the first chapter of the book.
    I know ou have no idea whats in the chapter but thtas what he was...
  13. Replies
    12
    Views
    2,007

    Oh thanks also for the () around ;0 what is the...

    Oh thanks also for the () around ;0 what is the purpose of doing this i wonder?
    Thanks alot.
  14. Replies
    12
    Views
    2,007

    Try using the header file . I only...

    Try using the <cstdlib> header file .
    I only know srand so i could be wrong.
    And your return 0; is mistake also.
    take away the () sourounding the 0;
  15. Replies
    12
    Views
    1,433

    Hi after seen your post i had to also try this...

    Hi after seen your post i had to also try this and it took me ages to figure it out.

    I couldn't do it with the modulas operator so can someone show me how?
    Maybe just an example?

    My code is...
  16. Replies
    20
    Views
    6,765

    Selective truth is very appealing.:)

    Selective truth is very appealing.:)
  17. Thread: Variables

    by blackgold>>
    Replies
    3
    Views
    1,018

    Maybe try string ?

    Maybe try string ?
  18. Replies
    5
    Views
    892

    I see what you mean now. I tried the examples...

    I see what you mean now.

    I tried the examples you gave also and it's cool.

    Thanks both of you.

    I sometimes learn to much then have to go back when i see something i don't quite understand.
    ...
  19. Replies
    5
    Views
    892

    Oh that was typing mistake but my question is...

    Oh that was typing mistake but my question is still the same.
    Thanks.
  20. Replies
    5
    Views
    892

    for structure whitout {}?

    for ( int i = 0; i <= 10; i++ ) ;
    cout << setw( 2 ) << i << "! = " << factorial( i ) << endl;

    return 0;

    }



    Ok i am learning functions right now and was wondering why does the code in...
  21. Replies
    6
    Views
    1,158

    Just wanted to get you to know you should use...

    Just wanted to get you to know you should use the standard template library.

    #include <iostream.h>
    #include <string.h>
    #include <stdlib.h>


    instead use these

    #include <iostream>
  22. Replies
    1
    Views
    892

    debug symbols?

    How can i add debug symbols so i can see whats going on better.
    BTW i'm on devc++4 .
    GDB debuger.
    Thanks alot




    //recursive factorial function
    #include <iostream>
  23. Replies
    3
    Views
    832

    Ok here is output. Enter number 12 1st 12...

    Ok here is output.

    Enter number 12
    1st 12
    2nd 12
    3rd 12
    1st 11
    2nd 132
    3rd 11
    1st 10
  24. Replies
    3
    Views
    832

    Hi hammer thanks alot i wrote wrong word. I will...

    Hi hammer thanks alot i wrote wrong word.
    I will try what you said
  25. Replies
    3
    Views
    832

    post-decremented when?

    #include <iostream>
    using namespace std;

    int main()
    {

    unsigned long factorial = 1,
    number = 0;

    cout <<" Enter number " ; // entered 12 as number
Results 1 to 25 of 28
Page 1 of 2 1 2