Rotations of a Binary String with Odd Value | C # program to find count of rotations with odd value . ; function to calculate total odd decimal equivalent ; Driver code
using System ; class GFG { static int oddEquivalent ( String s , int n ) { int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s [ i ] == '1' ) count ++ ; } return count ; } public static void Main ( ) { String s = "1011011" ; int n = s . Length ; Console . WriteLine ( oddEquivalent ( s , n ) ) ; } }