Creating number or symbol patterns is used to check command of a programmer or a student on for loop. In short its done just for practicing for loop.
Here are some common number patterns :
Here are some common number patterns :
public class numPtr { public static void main( String arg[]){ for(int i=1;i<=5;i++){ for(int j=1;j<=i;j++){ System.out.print(j); } System.out.println(); } } }
Pattern 2.
To Print this pattern use the following code:
public class numPtr { public static void main( String arg[]){ for(int i=1;i<=5;i++){ for(int j=5;j>=i;j--){ System.out.print(j); } System.out.println(); } } }
Pattern 3.
To Print this pattern use the following code:
public class numPtr { public static void main( String arg[]){ for(int i=1,r=5;i<=5;i++,r--){ for(int j=1;j<=r;j++){ System.out.print(j); } System.out.println(); } } }
Pattern 4.
public class numPtr { public static void main( String arg[]){ int ck=0,c=2; while(c>0){ if(ck==0){ for(int i=1;i<=5;i++){ for(int j=1;j<=i;j++){ System.out.print(j); } System.out.println(); } ck++; } else{ for(int i=1,r=5-1;i<=5-1;i++,r--){ for(int j=1;j<=r;j++){ System.out.print(j); } System.out.println(); } } c--; } } }Pattern 5.
public class numPtr { public static void main( String arg[]){ int ck=0,c=2; while(c>0){ if(ck==0){ for(int i=1,r=5;i<=5;i++,r--){ for(int j=1;j<=r;j++){ System.out.print(j); } System.out.println(); } ck++; } else{ for(int i=2;i<=5;i++){ for(int j=1;j<=i;j++){ System.out.print(j); } System.out.println(); } } c--; } } }Author Note: All the above examples gives output till 5, you can change it accordingly by changing the conditions.
1223 Comments Leave new
«Oldest ‹Older 401 – 600 of 1223 Newer› Newest»try it....
Replyclass fun
{
public static void main(String args[])
{
int a=0;
for(int i=1; i<=5; i++)
{
for(int j=5; j>a; j--)
{
System.out.print("_");
}
for(int k=i; k>0; k--)
{
System.out.print(k);
}
System.out.println();
a++;
}
}
}
how to print below pattern for any random number..
Reply01 02 03 04 05
16 17 18 19 06
15 24 25 20 07
14 23 22 21 08
13 12 11 10 09
Help me print the following pattern depending on the input please :-
Replyinput=1
0
input=2
0
00
input=3
0
0
000
----0
----0
input=4
0
0
0
0000
------0
------0
------0000
and so on..
("---" are supposed to be blank, but blank spaces were not counted in the question here so i used those)
so basically its a step pattern where it ends with a vertical line if the number is odd and horizontal line if its even number.
Please help me to solve the below problem :
Replyinput:
n=4,k=2
1,1,1,1
1,1,1,2
1,1,2
1,2,1
2,2
code for :
Reply1 2 3 4
8 7 6 5
9 10 11 12
16 15 14 13
please send me the java programming code for following pattern
Reply1
222
33333
4444444
please send me the java programming code for following pattern
Reply1
222
33333
4444444
class AddSubEx
Reply{
public static void main(String args[])
{
int sum=0;
for(int i=1; i<=10; i++)
{
if(i%2==0)
{
if(i==10)
System.out.print(i+" = ");
else
System.out.print(i+"+");
sum=sum-i;
}
else
{
System.out.print(i+"-");
sum=sum+i;
}
}
System.out.println(sum);
}
}
Can you tell me code for this pattern
Reply1
23
456
7890
1
Reply121
12321
1234321
1
Reply121
12321
1234321
i want like this
Reply11 12 13
21 22 23
31 32 33
with nested loop
can i get program for this 1 1
Reply12 21
123 321
1234 4321
123454321
Hi.
Reply1
11
21
1211
111221
=>Here in every line we are talking about the pervious line elements
like----- in line 2=.> one time 1
in line 3= > two times 1
in line 4=> one time 2, one time 1
in line 5 = > one time 1, one time 2, two times 1
in line 6 = > three times 1, two times 2, one time 1
Hi.
Reply1
11
21
1211
111221
=>Here in every line we are talking about the pervious line elements
like----- in line 2=.> one time 1
in line 3= > two times 1
in line 4=> one time 2, one time 1
in line 5 = > one time 1, one time 2, two times 1
in line 6 = > three times 1, two times 2, one time 1
can i get the code for following pattern?
Reply*
**
***
****
*****
****
***
**
*
can i get the code for
Reply*
_**
__***
___****
____*****
___****
__***
_**
*
code for
Reply1234
--123
---12
-----1
how to print a dynamic arrow with filled "*"?
Replyplz sove this to print
Reply*
**
***
****
*****
code for :
Reply1
01
101
0101
10101
CODE FOR THIS PROGRAM
Reply1234321
123*321
12***21
1*****1
input: i love programming
Replyoutput: i
love
programming
can u say how to sum the series
Replys=1 - x^2/2! + x^4/4! - x^6/6! + x^8/8! - x^10/10!
one of the programs in my text plz ans it
can u plz explain the codes for this??
Replycan u plz explain the codes of this.. i need it..
ReplyHow to create this pattern
Replyint arr = {3,4,-3,5,-6}
Output
___*
____*
*___
_____*
*______
URGENT!!
ReplyHow to create this pattern...
int arr = {3,4,-3,5,-6}
Output
___*
____*
*___
_____*
*______
sir plz help me!!
Replyi/p-I love to study
o/p-I
love
to
study
hi codenirvana admin!!!!
Replynice work keep it on...
1*2*3*4
5*6*7*8
9*10*11*12
can u give code for ths
Please help me.
Replyoutput: using 3 for loops
xoxoxoxoxoxo
oxoxoxoxoxox
xoxoxoxoxoxo
oxoxoxoxoxox
xoxoxoxoxoxo
Sir please help me with this.
ReplyCan you give the code with the number limit 7?
1
23
456
7
Sir please help me with this.
ReplyCan you give the code with the number limit 7?
1
23
456
7
how to write a program to display the following pattern
Reply* * * * * * * *
* *
* *
* *
* * * * * * * *
* 1 2 3 *
* 4 5 6 *
* 7 8 9 *
* * * * * * * *
how to write a program to display the following pattern
Reply* * * * * * * *
* *
* *
* *
* * * * * * * *
* 1 2 3 *
* 4 5 6 *
* 7 8 9 *
* * * * * * * *
how to write a program to display the following pattern
Reply* * * * * * * *
* *
* *
* *
* * * * * * * *
* 1 2 3 *
* 4 5 6 *
* 7 8 9 *
* * * * * * * *
how to write a program to display the following pattern
Reply* * * * * * * *
* *
* *
* *
* * * * * * * *
* 1 2 3 *
* 4 5 6 *
* 7 8 9 *
* * * * * * * *
in simply want mobile patern
print:
ReplyA
BB
CCC
DDDD
EEEE....and so on
Scanner in = new Scanner(System.in);
ReplySystem.out.println("Enter the Start number to print");
int n=in.nextInt();
int l,j,k,m=5;
for(k=1;k<=m;k++){
/*for(l=1;l<=m;l++){
System.out.print(" ");
}*/
for(j=1;j<=k;j++){
System.out.print(n);
}System.out.println();
n++;
}
try this
Help me with this pattern (using JOptionPane)
Reply1
1 1 1
1 1 1 1 1
1 1 1 1 1 1 1
If firstNumber=40; secondNumber=45; thirdNumber=50; WAP to find percentage and division
Replywhat is the code of this program
the code for
Reply12345
2345
345
45
5
is possible as follows:
class N
{
public static void main(String[] args)
{
int k;
for(int i=1;i<=5;i++)
{
k=i;
for(int j=5;j>=i;j--)
{
System.out.print(k);k++;
}
System.out.println();
}
}
}
how to print this pattern
Reply1234
2341
3412
4123
how to print this pattern
Reply1234
2341
3412
4123
can any one tell me the code for A shape
Reply*******
* *
*******
* *
* *
sir can you help me in doing the following pattern:
Replyif n=4
1
2 4
3 6 9
4 8 12 16
please give me the code of the following
Reply1
31
531
7531
97531
Sir can you please solve this...its a request to you..
Reply123456789
2345678
34567
456
5
456
34567
2345678
123456789
what will be the code for
Reply$$$$$
$$$$$
$$$$$
$$$$$
$$$$$
what is the code for
Reply$$$$$
$$$$$
$$$$$
$$$$$
$$$$$
Could you please help me to print the below pattern?
Reply1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
give me the code for *****
Reply****
***
**
*
Please print this pattern
Reply1
23
451
2345
12345
Please print this pattern
Reply1
23
451
2345
12345
import java.lang.*;
Replyclass pattern8
{
public static void main(String args[])
{
for(int i=4;i>0;i--)
{
for(int j=i;j>0;j--)
{
System.out.print(i);
}
System.out.println();
}
for(int i=2;i<=4;i++)
{
for(int j=i;j>0;j--)
{
System.out.print(i);
}
System.out.println();
}
}
}
how to write a twelve loop program urgent tomarrow i have exam
Replyhow to write a twelve loop program
Replyplz help for code of below o/p:
Reply1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Sir help me to know the code of this output
Reply*****
*
*
*
*****
help me to find the of this output please
Reply**
**
**
*****
*****
help me for this pattern
Reply11
12 22
13 23 33
14 24 34 44
15 25 35 45 55
Sir can you help me to print the pattern
Reply1 1
2 1 1 2
3 2 1 2 3
4 3 3 4
5 5
class example
Reply{
public static void main(String args[])
{
int i,j, k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.print(" ");
for(k=i;k>=1;k--)
{
System.out.print(k);
}
System.out.println();
}
}
}
class example
Reply{
public static void main(String args[])
{
int i,j, k;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.print(" ");
for(k=i;k>=1;k--)
{
System.out.print(k);
}
System.out.println();
}
}
}
class big
Reply{
public static void main(String args[])
{
int i,j;
for(i=1;i<=5;i++)
{
for(int k=i;k<=5;k++)
{
System.out.print(k);
}
System.out.println();
}
}
}
class big
Reply{
public static void main(String args[])
{
int i,j;
for(i=1;i<=5;i++)
{
for(int k=i;k<=5;k++)
{
System.out.print(k);
}
System.out.println();
}
}
}
class ss
Reply{
public static void main(String args[])
{
int i,j,k=5;
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
{
System.out.print(j);
}
System.out.print(" ");
for(int m=i;m>=1;m--)
{
System.out.print(m);
}
System.out.println();
}
}
}
public static void main(String args[])
Reply{
int lineCount = 5;
for (int i = 1; i <= lineCount; i++) {
int value = i;
for (int j = 1; j <= i; j++) {
System.out.print(value + " ");
value += lineCount -j;
}
System.out.println("");
}
}
for :
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
class ss
Reply{
public static void main(String args[])
{
int i,j,k=5;
for(i=5;i>=1;i--)
{
for(j=i;j>=1;j--)
{
System.out.print(j);
}
System.out.print("_");
for(int m=1;m<=i;m++)
{
System.out.print(m);
}
System.out.println();
}
}
}
class ss
Reply{
public static void main(String args[])
{
int i,j,k=5;
for(i=1;i<=k;i++)
{
for(j=5;j>=i;j--)
{
System.out.print(j);
}
System.out.println();
}
for(i=4;i>=1;i--)
{
for(j=5;j>=i;j--)
{
System.out.print(j);
}
System.out.println();
}
}
}
sir can you help me...im doing a program but i want to enhance it...this is the output
Reply1 0 0 0 1
0 1 0 1 0
0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
can you please give me the snipet for this pattern:
Reply* * * *
* * *
* *
*
Sir,
ReplyPlz help me out with this pattern
*
*#
*#*
*#*#
*#*#*
Hi.... i want this output..can you please help me...
Reply0 0
1 0
0 1
1 1
2 0
0 2
2 1
1 2
2 2
3 0
0 3
3 1
1 3
3 2
2 3
3 3
1
Reply3*2
4*5*6
10*9*8*7
11*12*13*14*15
plz get me the code for this
Here is one more solution .
draw(5); // call this method with no. of rows you want to print in such pattern.
private static void draw(int a)
{
int row;
row=a;
int count=1;
List list=new ArrayList();
for(int i=0;i itr = list.iterator();
boolean bool=false;
while(itr.hasNext())
{
if(bool)
{
System.out.print("*");
}
System.out.print(itr.next());
bool=true;
}
list.removeAll(list);
}
else
{
Collections.reverse(list);
Iterator itr = list.iterator();
boolean bool=false;
while(itr.hasNext())
{
if(bool)
{
System.out.print("*");
}
System.out.print(itr.next());
bool=true;
}
list.removeAll(list);
}
System.out.println();
}
}
hello sir can you help me to print
Reply1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3
hey please someone can you help me to print this pattern
Reply1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3
Plz help me.....
Replyinput----- 4
output----
2
3. 5
7 11. 13
17. 19. 23 29
ignore the dots
Reply123 321
Reply12 21
1 1
I'm having trouble making this code:
Reply"Write a program that asks the user for a size and a character, and then outputs a square pattern of that size using the character."
hello sir!!how to print this pattern?
Reply*
* *
* * *
* * * *
* * * * *
hello sir!!!!!! how to print rhis pattern??
Reply54321
4321
321
21
1
Hi is there a code for this:
ReplyWrite a program that will display the following pattern given the value of n, example if the value of n=5 the output:
.
._.
._._.
._._._.
._._.
._.
.
Sir, please can you get me the code for the below pattern...
Reply3
23
123
0123
123
23
3
Sir, please can you get me the code for the below pattern...
Reply3
23
123
0123
123
23
3
what will be following code
Reply@@@1
@@12
@123
1234
please tell me friends
ReplyDude can you solve this pattern asap
Reply54321
4321
321
21
1
Dude can you solve this pattern asap
Reply54321
4321
321
21
1
can you help me with this program?
Reply1
2 4
1 3 5
2 4 6 8
1 3 5 7 9
Please help me with this
Reply1 1
12 3
123 6
1234 10
1234515
and
@
@ @
@
55555
Reply45555
34555
23455
12345
Send Code Please
what will be the code for below pattern
Reply*
***
*****
*******
*********
***********
can you please help me with the pattern:
Reply0
2 4
6 8 10
12 14 16 18
20 22 24 28 30
how to print
Replya
a a
a a a
sir u r great u r doing a good job thank u soo much very helpfull
Replycan you type the code for
Reply5
454
34543
2345432
123454321
2345432
34543
454
5
as soon as possible
can you plz help me out to display n rows of the given pattern
Reply1
101
10001
1000001
i want a pattern
Reply5
4 4
3 3 3
2 2 2 2
1 1 1 1 1
Hello can any one solve this problem
ReplyPrint the word BHUPENDRA in star pattern or any other word in star pattern given by user....
Hello can any one solve this problem Print a big star ★ pattern inside this print asterisk symbol ★
Replylogic to print the below program
Reply1
2 4 6
3 6 9 12
4 8 12 16 20
please solve this pattern...
Reply1
2 3
3 4 5
4 5 6 7
5 6 7 8 9
solve this pattern please...
Reply1
2 3
3 4 5
4 5 6 7
5 6 7 8 9
sir can i have the code for the following pattern
ReplyN
NI
NII
NIIT
thanks and appreciate ...
What will be the input for this output, Sir?:
Reply1
234
56789
code please -
Replys=1+2/2!+3/3!+4/5!+........n
hey plese help me sir i
Replyi need a travel agency program
Here is the code for above problem
Replypublic class P4
{
public static void main(String [] args)
{
int i,j,count=1,k=0,pos=0;
for(i=0;i<5;i++)
{
k=i;
for(j=0;j<=i;j++)
{
if(i%2==0)
{
if(j!=i)
System.out.print(count + "*");
else
System.out.print(count);
count++;
}
else
{
if(j!=i)
System.out.print(count+k + "*");
else
System.out.print(count+k);
k--;
}
}
if(i%2==1)
count=count+j;
System.out.println();
}
}
}
public class P4
Reply{
public static void main(String [] args)
{
int i,j,count=1,k=0,pos=0;
for(i=0;i<5;i++)
{
k=i;
for(j=0;j<=i;j++)
{
if(i%2==0)
{
if(j!=i)
System.out.print(count + "*");
else
System.out.print(count);
count++;
}
else
{
if(j!=i)
System.out.print(count+k + "*");
else
System.out.print(count+k);
k--;
}
}
if(i%2==1)
count=count+j;
System.out.println();
}
}
}
how to write this pattern in java program?
Reply1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4
5 4 3 2 1 2 3 4 5
print the pattern 7531
Reply753
75
7
1
Reply12
123
1234
12345
Pls help me ...
wap in java to print the pattern 7531
Reply753
75
7
wap in java to print the pattern 333
Reply55555
7777777
plz comment fast i need it now
plz tell me the program to print
Reply9 99 999 9999 99999 999999..........n
all total roman number print in java.
Reply1-100
What will be the code for this pattern:
Reply* *
********
**********
************
**************
Sir What will be the code for the pattern
Reply1
2 1
3 2 1
4 3 2 1
5 4 3 2
How do u do
Reply1 4 7
2 5 8
3 6 9
0 0 0 0 0 0
Reply1 1 1 1 1
0 0 0 0
1 1 1
0 0
1
Hi Please provide the solution as soon ass possible
ReplyGiven an integer N, print N lines of the paFern. If N=4 then -
1*2*3*4*17*18*19*20
--5*6*7*14*15*16
----8*9*12*13
------10*11
Input: n-> Integer number of rows.
Given an integer N, print N lines of the paSern. If N=4 then -
Reply1*2*3*4
9*10*11*12
13*14*15*16
5*6*7*8
Input: n-> Integer number of rows.
Output: Printed paSern in those many number of rows
Given an integer N, print N lines of the paFern. If N=4 then -
Reply1*2*3*4*17*18*19*20
--5*6*7*14*15*16
----8*9*12*13
------10*11
Input: n-> Integer number of rows.
Output: Printed paFern in those many number of rows
Calculate the G.C.D of n numbers.
ReplyInput: arr -> array of posi8ve integers.
Output: GCD of input array elements.
Given two 8-bit-characters as input, determine if they can be placed successively in a gray code sequence.
ReplyInput: two 8-bit characters.
Output:An integer 1 if the required condi4on is met, 0 if not.
Hi Try this...............
Replypackage test;
public class DesignPattern8 {
public static void main(String[] args) {
int i, j;
int n = 5;
int k = 1;
int temp = 0;
for (i = 1; i <= n; i++) {
if (i % 2 != 0) {
for (j = 0; j < i; j++) {
if (j < i - 1) {
System.out.print(k + "*");
k++;
} else {
System.out.print(k);
k++;
}
}
}
else
{ k=k+i-1;
for(j=0;j<i;j++)
{
if (j < i - 1) {
System.out.print(k + "*");
k--;
} else {
System.out.print(k);
k--;
}
}
temp=temp+2;
k=k+1+temp;
}
System.out.println();
}
}
}
How to Print the sum of Series in Java?
ReplyS=1+(1*2)+(1*2*3)+.........+(1*2*3*.............*20)
class Temp
Reply{
public static void main(String[] args)
{
int n=4;
for(int i=n;i>0;i--){
for(int j=1;j<=n;j++){
System.out.print(n);
}
System.out.println();
n--;
}
n=2;
for(int i=n+1;i>0;i--){
for(int j=1;j<=n;j++){
System.out.print(n);
}
System.out.println();
n++;
}
}
}
how to print
Reply1 3 5 7 9
3 5 7 9 1
5 7 9 1 3
7 9 1 3 5
9 1 3 5 7
*
Reply*A*
*ABA*
*ABCBA*
*ABCDCBA*
*ABCDEDCBA*
i want these codes asap plzzzzz its urgent
1
Reply21
321
4321
54321
please give the following pattern answer
pleeeeeeeeeeeeeeeeeeeeeeeeeeese
How to print
Reply1
32
654
10987
Hi Prathima
Replypleas find the code
public class Solution
{
public static void main(String[] args)
{
int i, j;
int n = 4;
int k = 1;
int temp = 0;
for (i = 1; i <= n; i++)
{
for (j = 0; j < i; j++)
{
System.out.print(k);
k--;
}
k++;
temp++;
k=k+i+temp;
System.out.println();
}
}
}
Code for this :
Reply1 1
1 1
1 1
0
1 1
1 1
1 1
it should come in a X shape. with zero in mid and 1s as the x's lines.....
and for this also :
*
*A*
*ABA*
*ABCBA*
*ABCDCBA*
*ABCDEDCBA*
Thank you :)
To print
Reply10 20 30
40 50 60
70 80 90
a
Replyabc
abcd
abcde
for N no. of lines
and when it reaches 'z' again start from 'a'
a
Replyabc
abcd
abcde
for N no. of lines
and when it reaches 'z' again start from 'a'
Sir I want a C or java program which should display the following output by taking value n=4
Reply1
2*3
4*5*6
7*8*9*10
4*5*6
2*3
1
1
Reply2 6
3 7 10
4 8 11 13
5 9 12 14 15
sir plz solve it .
Replygenerate the pattern where n can b between 1 to 26.
when n=1
then
_*
*A*
_*
n=2
__*
_*A*
*ABA*
_*A*
__*
...... and so on.
Sir what is the output for this pattern program.
Reply5
10 20
15 45 135
20 80 320 1280
1
Reply2 4
3 6 9
4 8 12 16
5 10 15 20 25
how to do this sir...??
1
Reply2 4
3 6 9
4 8 12 16
5 10 15 20 25
how to do this sir...??
5
Reply3 4 6
5 8 2 3
3 8 7 2 9
6 1 7 6 2 4
Sir I want a java program which should display the following
addition of highest number in each line
5+6+9+7=27
public class Pattern_b {
Replypublic static void main(String[] args) {
int i,j,r,n=4;
for(i=1,r=n;i<=n;i++,r--){
for(j=n;j>=i;j--){
System.out.print(r);
}
System.out.println();
}
for(i=2;i<=n;i++){
for(j=1;j<=i;j++){
System.out.print(i);
}
System.out.println();
}
}
}
how to do this-
Reply0405 1213 2021 2829
03 06 11 14 19 22 27 30
02 07 10 15 18 23 26 31
01 0809 1617 2425 32
for(int k=5-i ; k<4 ; k++){
ReplySystem.out.print(" ");
}
NO need this part for
12345
2345
345
45
5
if output like this
12345
2345
345
45
5
then only use
for(int k=5-i ; k<4 ; k++){
System.out.print(" ");
}
1
Reply1 2
1 2 3
Sir I want a java program which should display the following output
ReplyBY USING for loop.
1 2 3 4 5
1 5
1 5
1 5
1 2 3 4 5
Sir I want a java program which should display the following output
ReplyBY USING for loop.
1 2 3 4 5
1 5
1 5
1 5
1 2 3 4 5
Sir I want a java program which should display the following output
ReplyBY USING for loop.
1 2 3 4 5
1 5
1 5
1 5
1 2 3 4 5
public class series {
Replypublic static void main (String args[]){
for(int i=1,r=1;i<=5;i++,r++){
for(int j=1;j<=r;j++){
System.out.print(j);
}
if(r==5){System.out.print(" ");}
for(int k=r;k>=1;k--){
System.out.print(k);
}
System.out.println(); }
}
}
public class series {
Replypublic static void main (String args[]){
for(int i=1,r=1;i<=5;i++,r++){
for(int j=1;j<=r;j++){
System.out.print(j);
}
if(r==5){System.out.print(" ");}
for(int k=r;k>=1;k--){
System.out.print(k);
}
System.out.println(); }
}
}
sir i want your help. the pattern is shown below:
Reply1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
it will get input from user,,
Replyaccording to our input it will print.....
ie.
Enter any num : 5
if we give 5 as input
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
if we give any././ according to our input how to modify that
*****
Reply****
***
**
*
Plz give me code of this pattern
code for output:
Reply1
3 2
4 5 6
10 9 8 7
11 12 13 14 15
what is the code for printing
Reply12345
2 4
3 3
4 2
54321
Sir hep me out
ReplyWrite the java program for the pattern below
1
2*3
4*5*6
7*8*9*10
11*12*13*14*15
Sir Help me with this
ReplyWrite the program for the pattern below
1
3*2
4*5*6
10*9*8*7
11*12*13*14*15
for n=5
Reply*_*_*
_***_
*****
_***_
*_*_*
for n=7
*__*__*
_*_*_*_
__***__
*******
__***__
_*_*_*_
*__*__*
_=space
Please help! :)
001
Reply010
100
pattern print in java?
can u help with dis
Reply******
* *
* *
* *
******
Plz can u help me with this
Reply1
101
10001
1000001
Please get me a sloution for this code
Plz can u help me with this
Reply1
101
10001
1000001
Please get me a sloution for this code
input: 3
output:
3 3 3 3 3
3 2 2 2 3
3 2 1 2 3
3 2 2 2 3
3 3 3 3 3
anyone can answer?
input:4
Replyoutput:
4 4 4 4 4 4 4
4 3 3 3 3 3 4
4 3 2 2 2 3 4
4 3 2 1 2 3 4
4 3 2 2 2 3 4
4 3 3 3 3 3 4
4 4 4 4 4 4 4
can anyone try it out?
plzz give me code.
can u give me code for
Reply*****
* *
* *
* *
*****
*123*
*456*
*789*
*****
how to print
Reply1030
0204
1030
0204
plz
Replyhelp to print
I
C S
E E E
X A M S
for above program output is displayed as :
Reply111112
222223
333334
444445
555556
666667
But as per problem statement is should be displayed as follow ;
111112
322222
333334
544444
555556
766666
package com.pattern;
Replyimport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Pattern5 {
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub
System.out.println("Enter a number");
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
Integer n = Integer.parseInt(bufferRead.readLine());
for (int i = 0; i <=n; i++) {
for (int j = i + 1; j <=n; j++) {
System.out.print(j);
}
System.out.println("");
}
}
}
package com.pattern;
Replyimport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Pattern6 {
public static void main(String[] args) throws NumberFormatException, IOException {
// TODO Auto-generated method stub
System.out.println("Enter a number");
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
Integer n = Integer.parseInt(bufferRead.readLine());
for (int i = n; i >0; i--) {
for (int j = 0; j <i; j++) {
System.out.print(i);
}
System.out.println("");
}
for (int i = 2; i <=n; i++) {
for (int j = 0; j <i; j++) {
System.out.print(i);
}
System.out.println("");
}
}
}
What will be the code for this pattern:
Reply1
131
13531
1357531
13531
131
1
public class NumberPattern
{
public static void main(String args[])
{
int i,j,k,g=1,n=4,p=2,f=2,b=3,r=5;
for(i=1;i<=7;i++)
System.out.print(" "+n);
System.out.println();
for(j=1;j<=5;j++)
{
for(k=4;k>=3;k--)
//if(k==4 || k==3 )
System.out.print(" "+k);
for(int d=r-j;d>=-1;d--)
{
if(d==4)
System.out.print(" "+b);
if(d==3)
System.out.print(" "+f);
if(d==2)
System.out.print(" "+d);
if(d==1)
System.out.print(" "+f);
else if(d==0)
System.out.print(" "+b);
break;
}
for(int d=r-j;d>=-1;d--)
{
if(d==4)
System.out.print(" "+b);
if(d==3)
System.out.print(" "+f);
if(d==2)
System.out.print(" "+g);
if(d==1)
System.out.print(" "+f);
else if(d==0)
System.out.print(" "+b);
break;
}
for(int d=r-j;d>=-1;d--)
{
if(d==4)
System.out.print(" "+b);
if(d==3)
System.out.print(" "+f);
if(d==2)
System.out.print(" "+d);
if(d==1)
System.out.print(" "+f);
else if(d==0)
System.out.print(" "+b);
break;
}
for(k=3;k<=4;k++)
//if(k==4 || k==3 )
System.out.print(" "+k);
System.out.println();
}
for(i=1;i<=7;i++)
System.out.print(" "+n);
}}
int count=0;
Replyfor(int i=1;i<9;i++){
for(int j=1;j<=2*i-1;j++){
if(i>j||i==j){
count=count+1;
System.out.print(count);
}
else{
count=count-1;
System.out.print(count);
}
}
System.out.println();
}
int count=0;
Replyfor(int i=1;i<9;i++){
for(int j=1;j<=2*i-1;j++){
if(i>j||i==j){
count=count+1;
System.out.print(count);
}
else{
count=count-1;
System.out.print(count);
}
}
System.out.println();
}
can u pls tell about this
Reply1234554321
1234 4321
123 321
12 21
1 1
HI CAN YOU PLEASE SEND ME THE CODE TO PRINT THE FOLLOWING PATTERN
Reply6 6 6 6 6 5
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
code for following pattern
Reply1) 12345
2345
345
45
5
2) 1
21
321
4321
54321
what will be the program for pattern
Reply1
212
32123
4321234
543212345
Hello Sir,
Replyi want to print following pattern
1
1 0
1 0 0
1 0 0 0
1 0 0 0 0
if 'i' incremented then 's' will also increment isn't it
Replyprogram for
Reply5
5
55555
5
5
package num;
Replypublic class numericale {
public static void main(String args[]){
int i,j,k=1,rows;
rows=4;
for(i=1;i<=rows;++i)
{
for(j=1;j<=i; j++,k++)
{
System.out.print(k);
}
System.out.println();
}
}
}
package num;
Replypublic class numericale {
public static void main(String args[]){
int i,j,k=1,rows;
rows=4;
for(i=1;i<=rows;++i)
{
for(j=1;j<=i; j++,k++)
{
System.out.print(k);
}
System.out.println();
}
}
}
i want this pattern how to make it..
Reply***********
***** *****
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
***** *****
***********
Make sure you tick the "Notify Me" box below the comment form to be notified of follow up comments and replies.