3. Write a program that will print the following output 1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 1 2 4 8 16 8 4 2 11 2 4 8 16 32 18 8 4 2 1, import java.util.Scanner;public class PracticeDemo { public static void getNumber(int number){ int middle=1; String start="1",end="1",output; System.out.println(start); for(int i=1;i<=number;i++){ middle=middle*2; output=start+" "+middle+" "+end; System.out.println(output); start=start+" "+middle; end=middle+" "+end; } } public static void main(String [] args){ Scanner sc=new Scanner(System.in); System.out.println("Enter the number"); int x=sc.nextInt(); getNumber(x); sc.close(); } }output:11 2 11 2 4 2 11 2 4 8 4 2 11 2 4 8 16 8 4 2 11 2 4 8 16 32 16 8 4 2 11 2 4 8 16 32 64 32 16 8 4 2 11 2 4 8 16 32 64 128 64 32 16 8 4 2 11 2 4 8 16 32 64 128 256 128 64 32 16 8 4 2 11 2 4 8 16 32 64 128 256 512 256 128 64 32 16 8 4 2 11 2 4 8 16 32 64 128 256 512 1024 512 256 128 64 32 16 8 4 2 1, I would say we should have i=1) && (d<31)); //||((m>=1) && (m<12));//||((y>=00) && (y<99)); if(!valid) System.out.print("Invalid date"); else { switch (dd) { case "01": System.out.print("First of "); switch (mm) { case "01": System.out.print("January,2020"); break; Feel free to comment, ask questions if you have any doubt. a program in Java to reverse any String without using StringBuffer? Factorial, which is for n! The best way we learn anything is by practice and exercise questions. *;class freqWORD{ int count=0; public void main()throws IOException { BufferedReader b=new BufferedReader (new InputStreamReader(System.in)); System.out.println("Enter a line"); String line=b.readLine(); System.out.println("Enter thew word to be searched"); String word=b.readLine(); line=" "+line +" " ; line=line.replace(word, "0"); for(int i=0; i
Cardigan Welsh Corgi Colors, Schengen Visa Countries, Roomba E6 Vs E5, Bear Brook Valley Capacity, Kenma Gif Cute, Career Aptitude Test Reddit 2020, Tokay Gecko Bite Poisonous, Carn A' Mhaim, Ben Macdui,