Computer Science, asked by ShubhamKumar1357, 1 year ago

Write a program to print a pattern by using 2 loop in Java language
13579
35791
57913
79135
91357

Answers

Answered by Anonymous
3
ANSWER
..........

import java.io.*;
class LL
{


public static void main(String args[])throws IOException
{



BufferedReader br=new BufferedReader(new InputStreamReader(System.in));




System.out.println("Enter Number Limit ");
int n=Integer.parseInt(br.readLine());
int k=2;



int l=3;



System.out.print("1"+" "+"3"+" ");



for(int i=1;i<=n;i++)
{
k+=Math.pow(2,i-1);


l+

System.out.print(l+" ");
}
}
}

ShubhamKumar1357: Thanks
ShubhamKumar1357: but this is not correct program
ShubhamKumar1357: After compiling different pattern is printed
Similar questions