Now print the smallest twin in range
for ( $ i = $ low ; $ i <= $ high ; $ i ++ ) { if ( $ prime [ $ i ] && $ prime [ $ i + 2 ] ) { print ( " Smallest ▁ twins ▁ in ▁ given ▁ range : ▁ ( $ i , ▁ " . ( $ i + 2 ) . " ) " ) ; $ twin = true ; break ; } } if ( $ twin == false ) print ( " No ▁ such ▁ pair ▁ exists STRNEWLINE " ) ; }