Increasing decreasing sequence

help me solve this please

hint
make two boolean variable inc and dec
set both to false;
take first 2 element and then accordingly set inc or dec to true

now take input one by one
and check the condition that
if it is inc is true then sequence should not be decreasing
if two consecutive values are equal return false

now try to implement it
and share the link of code i will see it and help you

#include using namespace std; bool increasingDecreasingSequence(int n){ bool decreasing = true; int prev; cin >>prev; for(int i = 1 ;i<=n-1;i++){ int current; cin >> current; if(current==prev){ return false; break; } else if(current>prev){ decreasing = false; } else if(!decreasing && current<prev){ return false; break; } } return true; } int main() { int n; cin >> n; if(increasingDecreasingSequence(n)){ cout<<“true”<<"\n"; } else{ cout<<“false”<<"\n"; } return 0; }

this is code please help me

how can i check this code :worried:

paste you code at

click on file->save->link will be generated
send the link of code generated
it will look like https://ide.codingblocks.com/s/258793

https://ide.codingblocks.com/s/277124 here is the link

you have to use 2 variables inc and dec
also intially both are false

look at modified Code

Modified Code

please tell what is wrong with my code

 if (j < i)
        {s = true;}
        else if (i > j)
        {m = true;}

these two condition are same