Pseudocode Assignment

Sir in question number 1 ( 1st Part )
how to decrease the numbers after getting the highest number?

Hi @Priyanshu_Sharma

we can take a counter variable which would start decrementing when it has taked steps equal to row

pseudo code would be like

count = 1 ;
for(int i =1; i <= n ; i++) {
num= i+1;
for(int j = 1 ; j < 2* i ; j++){
      cout<< num;
      if(count > i ) num -= 1; // start reducing from here on   when counter > row value
       else num += 1;
count+=1;
  }
}

@Priyanshu_Sharma Did you get the logic.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.