Results 1 to 3 of 3

Thread: a

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    2

    a

    #include<iostream>
    using namespace std;
    int main(void)
    {
    int power,ctr,base,answer;

    cout<<"Enter Number to raised=";

    cin>>power; cin.ignore();

    cout<<"Enter Number=";

    cin>>base; cin.ignore();

    for(ctr=1;ctr<=power;ctr++)

    answer=answer*base;



    {


    cout<<"The answer is="<<answer;

    }
    cin.get();
    return 0;
    }

    What's wrong with my code? Can you please help me?

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    2

    Re: a

    #include<iostream>
    using namespace std;
    int main()
    {
    int power,ctr,base,answer;

    cout<<"Enter Number to raised=";

    cin>>power; cin.ignore();

    cout<<"Enter Number=";

    cin>>base; cin.ignore();

    for(ctr=1;ctr<=power;ctr++)

    answer=answer*base;



    {


    cout<<"The answer is="<<answer;

    }
    cin.get();
    return 0;
    }

  3. #3
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: a

    Quote Originally Posted by rosh View Post
    ...
    What's wrong with my code? Can you please help me?
    Welcome to VBForums.

    No.
    Not unless you make an effort yourself. For instance you can provide the thread with a meaningful title describing the question, and describe the actual problem with your code.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width