#include<iostream>
using namespace std;
main( )
{
int n,a,b,large,small;
cout << "Enter number of Integer in array" << endl;
cin >> n;
int num[ n] ;
cout << "Enter element of array " ;
for ( int p= 0 ; p< n; p++ )
cin >> num[ p] ;
for ( int k= 0 ; k< n- 1 ; k++ )
{
a= num[ k] ;
b= num[ k+ 1 ] ;
if ( ( num[ k] - num[ k+ 1 ] == 1 ) || ( num[ k+ 1 ] - num[ k] == 1 ) || ( num[ k] == num[ k+ 1 ] ) )
{
cout << "No intermediate element present in between these " << num[ k] << " & " << num[ k+ 1 ] << " elements" ;
}
else
{
large= a> b? a: b;
small= a< b? a: b;
cout << "Element between " << num[ k] << " and " << num[ k+ 1 ] << " is/are " ;
for ( int p= small; p< large- 1 ; )
{
cout << ++ p<< " " ;
}
}
cout << endl;
}
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cm1haW4oKQp7CmludCBuLGEsYixsYXJnZSxzbWFsbDsKY291dDw8IkVudGVyIG51bWJlciBvZiBJbnRlZ2VyIGluIGFycmF5Ijw8ZW5kbDsKY2luPj5uOwppbnQgbnVtW25dOwpjb3V0PDwiRW50ZXIgZWxlbWVudCBvZiBhcnJheSAiOwpmb3IoaW50IHA9MDtwPG47cCsrKQpjaW4+Pm51bVtwXTsKZm9yKGludCBrPTA7azxuLTE7aysrKQp7CglhPW51bVtrXTsKCWI9bnVtW2srMV07CglpZigobnVtW2tdLW51bVtrKzFdPT0xKSB8fCAobnVtW2srMV0tbnVtW2tdPT0xKSB8fCAobnVtW2tdPT1udW1baysxXSkpCgkJewoJY291dDw8Ik5vIGludGVybWVkaWF0ZSBlbGVtZW50IHByZXNlbnQgaW4gYmV0d2VlbiB0aGVzZSAiPDxudW1ba108PCIgJiAiPDxudW1baysxXTw8IiBlbGVtZW50cyI7CgkgIH0KZWxzZQp7CmxhcmdlPWE+Yj9hOmI7CnNtYWxsPWE8Yj9hOmI7CmNvdXQ8PCJFbGVtZW50IGJldHdlZW4gIjw8bnVtW2tdPDwiIGFuZCAiPDxudW1baysxXTw8IiBpcy9hcmUgIjsKZm9yKGludCBwPXNtYWxsO3A8bGFyZ2UtMTspCnsKCWNvdXQ8PCsrcDw8IiAiOwp9Cn0KY291dDw8ZW5kbDsKfQp9