Social Sciences, asked by devpanchalpanchal25, 7 months ago

दीवानी से आप ज्या समाते ।
2​

Answers

Answered by smeetpatel2811
0

Answer:

Define a class numeral, described as below:

Data members:

num (int)

Member methods:

i) Numberal () - constructor to initialize member data to null .

ii) Accept () - to accept a value for the member data from the user.

iii) int Summation - to calculate and return the value of summation of num where –

(summation of num ) = 1+2+3…..+ num.

iv) int sumDigit () - to calculate and return the sum of the digits num.

Explanation:

Define a class numeral, described as below:

Data members:

num (int)

Member methods:

i) Numberal () - constructor to initialize member data to null .

ii) Accept () - to accept a value for the member data from the user.

iii) int Summation - to calculate and return the value of summation of num where –

(summation of num ) = 1+2+3…..+ num.

iv) int sumDigit () - to calculate and return the sum of the digits num.

Similar questions