1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klasskru [66]
3 years ago
8

Write a recursive method to form the sum of two positive integers a and b. Test your program by calling it from a main program t

hat reads two integers from the keyboard and users your method to complete and print their sum, along with two numbers.
Computers and Technology
1 answer:
77julia77 [94]3 years ago
5 0

Answer:

see the code snippet below writing in Kotlin Language

Explanation:

fun main(args: Array<String>) {

   sumOfNumbers()

}

fun sumOfNumbers(): Int{

   var firstNum:Int

   var secondNum:Int

   println("Enter the value of first +ve Number")

   firstNum= Integer.valueOf(readLine())

   println("Enter the value of second +ve Number")

   secondNum= Integer.valueOf(readLine())

   var sum:Int= firstNum+secondNum

  println("The sum of $firstNum and $secondNum is $sum")

   return sum

}

You might be interested in
This has nothing to do with anything school related, but I'm new to car audio and I was wondering, what happens or what would ha
DerKrebs [107]
It most likely can but It may damage your system. So you should seek out professional help from a car dealership and do more research.

Hope this helps.<span />
7 0
3 years ago
1. Answer the following questions: a. What are the different types of number system? Name them.​
BigorU [14]

Answer:

binary,decimal, hexadecimal and octal number system

5 0
2 years ago
Before donating a computer you should use a program to wipe the hard disk to remove all of its data
Elenna [48]
Yes you should. highly recommended
7 0
3 years ago
Read 2 more answers
Which type of workplace culture emphasizes the development of new skills?
Archy [21]
Involvement is the answer just took it. thank you

6 0
3 years ago
Read 2 more answers
The range A2:B4 has how many cells?   A. 2   B. 4   C. 6   D. 8
olya-2409 [2.1K]
The answer to that is D.
3 0
3 years ago
Read 2 more answers
Other questions:
  • How would you print from 1 to 1000
    13·1 answer
  • Which is most harmful computer virus define​
    15·1 answer
  • What information on social networking sites could be used to discriminate against a potential employee
    9·1 answer
  • Anna is looking for a job. Which two types of skills would she find necessary to secure a job ?
    5·1 answer
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • What did Charles Babbage design in 1822 to substitute values in polynomial equations? ENIAC TRADIC Analytical Engine Difference
    6·1 answer
  • What can be the maximum possible length of an identifier 3163 79 can be of any length​
    5·1 answer
  • Consider the following method, inCommon, which takes two Integer ArrayList parameters. The method returns true if the same integ
    15·1 answer
  • Demons I shall be your eternal nightmare
    13·1 answer
  • Discuss the advantages and disadvantages of supporting links to files that cross mount points (that is, the file link refers to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!