import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
String creditID;
String debitID;
Scanner in=new Scanner(System.in);
int count=0;
System.out.println("Enter credit transaction id: ");
creditID=in.next();
System.out.println("Enter debit transaction id: ");
debitID=in.next();
String s=creditID+debitID;
System.out.println(s);
for(int i = 0; i < s.length(); i++) {
if(s.charAt(i) != ' ')
count++;
}
System.out.println("Count= " + count);
}
}
Comments
Leave a comment