Hey friends! ☺
Please answer this question.
✔ Write a program in JAVA to print the given pattern:
1
11
121
1331
14641
❎ No spamming ❎
❌ No wrong answers❌
Answers
Answered by
2
Hey There!
Here's the simple code for your program:
public class Pattern
{
public static void main(String[] args)
{
int n=5;
for(int i=0;i<n;i++)
{
System.out.println((int)Math.pow(11,i));
}
}
}
What we did was just observe the following fact:
Then we wrote the code for it.
Hope it helps
Purva
Brainly Community
Here's the simple code for your program:
public class Pattern
{
public static void main(String[] args)
{
int n=5;
for(int i=0;i<n;i++)
{
System.out.println((int)Math.pow(11,i));
}
}
}
What we did was just observe the following fact:
Then we wrote the code for it.
Hope it helps
Purva
Brainly Community
LonelyHeart:
Thank u so much sir/madam
[I am a boy, though :) ]
[Others are those who assume gender themselves.] You did better :)
Answered by
0
public class Pattern
{
public static void main(String[] args)
{
int n=5;
for(int i=0;i<n;i++)
{
System.out.println((int)Math.pow(11,i));
}
}
}
What we did was just observe the following fact:
\begin{lgathered}1 = 11^0 \\ \\ 11 = 11^1 \\ \\ 121 = 11^2 \\ \\ 1331 = 11^3 \\ \\ 14641 = 11^4\end{lgathered}1=11011=111121=1121331=11314641=114
Then we wrote the code for it.
{
public static void main(String[] args)
{
int n=5;
for(int i=0;i<n;i++)
{
System.out.println((int)Math.pow(11,i));
}
}
}
What we did was just observe the following fact:
\begin{lgathered}1 = 11^0 \\ \\ 11 = 11^1 \\ \\ 121 = 11^2 \\ \\ 1331 = 11^3 \\ \\ 14641 = 11^4\end{lgathered}1=11011=111121=1121331=11314641=114
Then we wrote the code for it.
Similar questions
Math,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Hindi,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago
Science,
1 year ago