https://bugs.documentfoundation.org/show_bug.cgi?id=145401

Amad Khan <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
 Attachment #176032|tst:1 The veriable          |There is six bugs in code
        description|times_of_multiply  not used |we successfully identified
                   |in entire program           |it so we mentioned these in
                   |                            |this picture with code

--- Comment #8 from Amad Khan <[email protected]> ---
Comment on attachment 176032
  --> https://bugs.documentfoundation.org/attachment.cgi?id=176032
There is six bugs in code we successfully identified it so we mentioned these
in this picture with code

#include <iostream>

using namespace std;
public bool password(string password){ //first check password then user run
this program
    string pass="ak2563";  
    bool=false;
    if (pass==password){ // bug:2 we cant compare string like that
        bool=true;
        return true;
    }
    else {
        return bool;
    }
}

int main()
{
       int power;
    float number, result = 0; // bug:6 we need to initialized result=1 not "0" 

    int times_of_multiply;  //Bugs:1 This veriable times_of_multiply  not used
in entire program

    cout << "Enter number and number respectively:  ";
    cin >> number >> power;

    cout << number << "^" << power << " = ";

    while (power != 1) { // bug:3 not getting our expected result
        result *= number;
        --number; // bug:4 we need to decrement power not number
    }

    cout << result, number; // bug:5 we dont need to print number we need to
print just result

    return 0;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to