63 844
Assignments Done
99,2%
Successfully Done
In August 2018

Answer to Question #3473 in Java | JSP | JSF for Y mukundareddy

Question #3473
1. Write a program to sum two numbers, by defining your own function called public static void sum(int a, int b);
Expert's answer
public class Task4
{
public static void main(String[] args)
{
& System.out.println("5 + 2 = " + sum(5, 2));
& System.out.println("0 + 0 = " + sum(0, 0));
& System.out.println("-90807 + 14444 = " + sum(-90807, 14444));
}

// This function cannot be 'void' because it would return a result
public static int sum(int a, int b)
{
& return a + b;
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions