Signup/Sign In

C++ Program To Print A Given Pattern Or Series Like 12345, 5432, 234, 43, 3

Here, in this tutorial, we will see how to write the program for the given pattern and print the resultant series formed for the input number of terms by the user.

We believe that all the patterns covered in this section will help you understand this concept and visualize it better while forming your patterns, as such questions are very frequently asked in various interviews with a slight modification.

using namespace std;

int i,j,p=1,n,reverse;

int main()
  cout<<"Enter The Number To Print A Pattern\n";
  int dig=log10(n);

   while (n != 0)
        reverse = reverse * 10;
        reverse = reverse + n%10;
        n       = n/10;
 return 0; 

12345, 5432, 234, 43, 3


Here, in this tutorial mainly, we have to focus on the pattern of the series for how it is changing concerning the number of terms.