Computer Science, asked by prakritibaunthiyal8, 25 days ago

Total Computer Applications - 10
Solved Exercise
01.
Write a program, which can accept two numbers and retum
that the numbers can be integers or real numbers.
Ans.
public class Sum
l/function definition
public int sum(int a, int b)
{
return(a+b);
}
public double sum(double a, double b) //function definition
{
return( a+b);
I/function definition
public double sum(int x, double y)
{
return(x+y);
}
public double sum(double x, int y)
{
return(x+y);
}

Answers

Answered by techhtmlsa
1

Answer:

Explanation:Define a function intmax which takes a number pair and returns the greater of its two ... Define a recursive function to add up all the integers from 1 to a given upper limit. ... Write a function fromto which takes two numbers and a list and outputs all the ... An incorrect attempt to optimize the startswith program would combine .

Similar questions