#include<iostream> using namespacestd; int absolute(int v); //OR use abs() predefined function from cstdlib void printAscendingTriangle(int input); void printPattern(int input); void printDescendingTriangle(int input); void main(void) { int input; cout << "Input an integer: "; cin >> input; if(input > -3 && input < 3) { cout << "Invalid range." << endl; } else if(input % 2 == 0) { cout << "Odd integers only." << endl; } else { printAscendingTriangle(absolute(input)); printPattern(input); printDescendingTriangle(absolute(input)); } }

can you please help me to correct this code? the sample output should be in this format shown below. thank you.

~ Sample Outputs ~

Enter integer: 1

Enter integer: 2

Enter integer: 6

Enter integer: 2

Enter integer: 1

Enter integer: 5

Enter integer: 4

Enter integer: 2

Enter integer: 7

Enter integer: 8

Enter integer: 3

Enter integer: 0

The first 5 unique values are:

1 2 6 5 4

Enter integer: 2

Enter integer: 3

Enter integer: 2

Enter integer: 3

Enter integer: 1

Enter integer: 5

Enter integer: 2

Enter integer: 3

Enter integer: 1

Enter integer: 0

The first 5 unique values are:

2 3 1 5

Enter integer: 0

No unique values!