Computer Science, asked by oioioi2003com, 1 year ago

print the pattern in java.....:
1
11
121
1331
14641

Answers

Answered by shardul1925
29
Hello!!!

Question:

Print the pattern in java.

1
11
121
1331
14641.

Answer:

public class Program
{
public static void main(String[] args) {
int i;
for( i=0;i<=4;i++){
int z=(int)Math.pow(11,i);
System.out.println(z);
}
}
}


Hope it helps:)


Attachments:
Answered by qwnerazzuri
7

Java Program:

public class Main{

public static void main(String[] args) {

   for(int i=0; i<=4; i++)

        System.out.println((int)Math.pow(11,i));

}

}

it is a program to print powers of 11.

like,

11^{0} = 1

11^{1} = 1\\11^{2} = 121\\11^{3} = 1331\\11^{4} = 14641

Similar questions