text: Driver program to test above function
code: int main ( ) { char str [ ] = " geeksforgeeks " ; int index = firstNonRepeating ( str ) ; if ( index == INT_MAX ) printf ( " Either ▁ all ▁ characters ▁ are ▁ " " repeating ▁ or ▁ string ▁ is ▁ empty " ) ; else printf ( " First ▁ non - repeating ▁ character " " ▁ is ▁ % c " , str [ index ] ) ; return 0 ; }