Find the conjugate of a Complex number | C # implementation to find the conjugate of a complex number ; Function to find conjugate of a complex number ; Store index of ' + ' ; Store index of ' - ' ; print the result ; Driver code ; Initialise the complex number
using System ; class GFG { static void solve ( String s ) { String z = s ; int l = s . Length ; int i ; String str ; if ( s . IndexOf ( ' + ' ) != - 1 ) { i = s . IndexOf ( ' + ' ) ; str = s . Replace ( ' + ' , ' - ' ) ; } else { i = s . IndexOf ( ' - ' ) ; str = s . Replace ( ' - ' , ' + ' ) ; } Console . WriteLine ( " Conjugate ▁ of ▁ " + z + " ▁ = ▁ " + str ) ; } public static void Main ( String [ ] args ) { String s = "3-4i " ; solve ( s ) ; } }