Is That Possible In C# Coding That Is VB.Net Coding : Data Grid view

i tried if else condition in data grid view cells

 Dim RowIdx As Integer
        RowIdx = dgAttendance.CurrentRow.Index
        If dgAttendance.Item(3, RowIdx).Value = "P" Or dgAttendance.Item(3, RowIdx).Value = "P " Then
            dgAttendance.Item(3, RowIdx).Value = "A"
EndIF

Please Give The Solution in C#.
Ho Do i use That If Else Statement In C#

