Apocalyptic Number | C # program for the above approach ; Function to check if a number N is Apocalyptic ; Driver Code ; Given Number N ; Function Call
using System ; class GFG { static bool isApocalyptic ( int n ) { if ( Math . Pow ( 2 , n ) . ToString ( ) . Contains ( "666" ) ) return true ; return false ; } static public void Main ( ) { int N = 157 ; if ( isApocalyptic ( N ) ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } }