Answer to Question #3473 in Java | JSP | JSF for Y mukundareddy
2011-07-13T16:51:23-04:00
1. Write a program to sum two numbers, by defining your own function called public static void sum(int a, int b);
1
2011-08-07T07:14:41-0400
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 !
Learn more about our help with Assignments:
Java JSP JSF
Comments
Leave a comment