Do the following steps (add additional input parmas if any):-
using (SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=test;Integrated Security=True"))
using (SqlCommand cmd = new SqlCommand("SPname", con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@opparam1", SqlDbType.Int));
cmd.Parameters["@opparam1"].Direction = ParameterDirection.Output;
con.Open();
cmd.ExecuteNonQuery();
int outputvalue = (int)cmd.Parameters["@opparam1"].Value;
con.Close();
}