InterviewSolution
Saved Bookmarks
| 1. |
Write a program to accept two strings ......string st= "happy birthday" ".......string st1= "moments";......output =HAPPY MOMENTS........plss aolve with buffered reader i.e., IO |
|
Answer» Explanation:public STATIC void main(STRING args[]){BufferedReader demo= new BufferedReader(new InputStreamReader(System.in));int x,y,Z = 1;System.out.println("ENTER 1st number");x = Integer.parseInt(br.readline());System.out.println("Enter 2nd number");y = Integer.parseInt(br.readline());for(int i = x; i<= x * y; i++){if(i%x == 0 && i%y == 0){z = i;break;}}System.out.println("Therefore the LCM is :" +z);}HOPE IT HELP..CANT GIVE THE SPACE.MARK ME AS BRAINLIEST |
|