Use two numbers to calculate the sum and difference of products.
Using system;
Using system. Collections. Generic;
Using system. text;
Namespace bbsctianhui. oopstudy. consolestruct
{
Class Program
{
# Region
Static void main (string [] ARGs)
{
Mathstruct = new mathstruct ();
Mathstruct. operandfirst = 10;
Mathstruct. operandsecond = 12;
console. writeline (mathstruct. getaddvalue ();
console. writeline (mathstruct. getminusvalue ();
console. writeline (mathstruct. getmulitipvalue ();
console. readline ();
}< BR ># endregion
}
# region write method to struct
public struct mathstruct
{< br> Public int operandfirst;
Public int operandsecond;
///
///
/// sum
Public int getaddvalue ()
{< br> return (operandfirst + operandsecond);
}
///
// substration method
///
/// substration value
Public int getminusvalue ()
{< br> return (operandfirst-operandsecond);
}
///
/// mulitip method
///
/// mulitip value
Public int getmulitipvalue ()
{< br> return (operandfirst * operandsecond);
}< BR ># endregion
}