One thought on “Hello From Dcoder!

  1. Jose Elias Sanchez Quezada

    Hello.
    in the problem EXPONENTIA!. i can not figure out what wrong with the code i made. i have tested it with many cases and it work just fine according to what it is asked. but i can not get all the score.

    CREATE A CODE THAT ALLOWS PEOPLE TO LEARN ABOUT EXPONETS. THE TASK IS TO WRITE A CODE WHICH TAKES AN INTEGER NUMBER AS AN INPUT AND RETURNS THE VALUES RANGING FROM THAT OF 2(TWO) RAISED TO POWER OF 0(ZERO) TO 2(TWO) RAISED TO POWER N(THE NUMBER SPECIFIED IN INPUT)

    AND THIS IS MY CODE:
    #include
    using namespace std;
    #include

    void Power(int);

    int main(){
    int num;
    cin >> num;

    if(num>=0){
    for(int i=0;i0 && i>0){
    cout <<","<<pow(2,i);
    }else if(num==0){
    cout<0 && i==0){
    cout<=num;i–){
    if(i<0){
    cout <<","<<pow(2,i);
    }else {
    cout<<1;
    }
    }
    }
    }

    I need help to identify what it is wrong with my code.

    Reply