Find value of ( n ^ 1 + n ^ 2 + n ^ 3 + n ^ 4 ) mod 5 for given n | function for f ( n ) mod 5 ; if n % 5 == 1 return 4 ; else return 0 ; Driver Code
function fnMod ( n ) { if ( n % 5 == 1 ) return 4 ; else return 0 ; } let n = 10 ; document . write ( fnMod ( n ) + " " ) ; n = 11 ; document . write ( fnMod ( n ) + " " ) ;