Adblock breaks this site

c++ help

Discussion in 'Programming General' started by pineapfel, Jan 26, 2015.

  1. pineapfel

    pineapfel Member

    Joined:
    Jan 18, 2015
    Posts:
    42
    Referrals:
    0
    Sythe Gold:
    9
    c++ help

    i need someone to tell me how to make potantiation using a loop?

    so far i have :
    if(symbol=='^')
    {

    do{


    }while

    }

    also please include a cout<< line :p
     
  2. esWebos

    esWebos Active Member
    Banned

    Joined:
    Jan 19, 2015
    Posts:
    162
    Referrals:
    0
    Sythe Gold:
    0
    c++ help

    Are you trying to Potentiate a Matrix by using a Loop? You'll probably want to use the pow() function; and could you provide an explanation of use...

    The while and do-while loops repeat until a certain condition is met.
    The for loop repeats for a specific number of times.

    Do you know have a number in mind for the loop to occur or is it unknown?
     
  3. pineapfel

    pineapfel Member

    Joined:
    Jan 18, 2015
    Posts:
    42
    Referrals:
    0
    Sythe Gold:
    9
    c++ help

    well i want to potentiate x and y.
    i believe that i must make a third entry, let's say Z, as
    Z=x*x
    then it repeats y ammount of time

    ..i sincerealy am mind fucked.
    please use a do while or a for while loop and i swear to my razer naga i'll pay you in rsgp.
     
  4. esWebos

    esWebos Active Member
    Banned

    Joined:
    Jan 19, 2015
    Posts:
    162
    Referrals:
    0
    Sythe Gold:
    0
    c++ help


    ok, we'll get back to you shortly. happy face and lol we'll help you get un-mind fucked. Our staff basically trips balls all day until they come up with a solution--that's the nature and fun of programming.
     
  5. pineapfel

    pineapfel Member

    Joined:
    Jan 18, 2015
    Posts:
    42
    Referrals:
    0
    Sythe Gold:
    9
    c++ help

    thank you :p
    also i would liek to learn for future so //comments are welcome too :p

    EDIT:

    so far i came up with this...still need a little more with the potentions..

    if(operacija=='^')
    { m=1;
    do{

    m=m+1;
    }while(m<=y);



    }


    EDIT

    if(operacija=='^')
    { m=1;
    rezultat=x;
    do{
    rezultat=rezultat*x;

    m=m+1;
    }while(m<=y-1);
    std::cout<<rezultat<<std::endl;



    }

    took me a while but got it :)
     
< Build jar from another application | Can anyone become a programmer? >


 
 
Adblock breaks this site