wap in java to input a integers n1 and n2. merge n2 after n1 and store merged number in m.print n1,n2 and merged number m(do not simply print the number)
Answers
Answered by
1
Answer:
The code is written in java , where the class merges two integer numbers, it has a function which will return the integer value of the string.
class Merge{
static int merging(int number1, int number2)
{
String n1 = Integer.toString(number1);
String n2 = Integer.toString(number2);
String s = n1 + n2;
int m = Integer.parseInt(s);
return m;
}
public static void main(String args[])
{
int number1 = 11
int number2= 12;
System.out.println(merging(number1, number2));
}
}
Similar questions
English,
6 months ago
Chemistry,
1 year ago
India Languages,
1 year ago
History,
1 year ago
English,
1 year ago