You can give the correct Answer for the given problem and Share knowledge too.. Submit your Answer in the comment Line.
---------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------
import java.util.*;
class Example{
public static void printTotal(int num1, int num2){
int tot=num1+num2;
System.out.println(num1+" + "+num2+" = "+tot);
}
public static void main(String args[]){
Scanner input=new Scanner(System.in);
System.out.print("Input number 1 : ");
int num1=input.nextInt();
System.out.print("Input number 2 : ");
int num2=input.nextInt();
printTotal(num1,num2);
printTotal();
}
}
What is the Compile time Error in this code and Explain Breifly.
Output :
----------------------------------------------------------------------------------------------------------------------

0 comments:
Post a Comment