12345 1234 123 12 1 |
12345 2345 345 45 5 |
Code of above pattern |
Code of above pattern |
54321 4321 321 21 1 |
54321 5432 543 54 5 |
Code of above pattern |
Code of above pattern |
1 12 123 1234 12345 |
5 45 345 2345 12345 |
Code of above pattern |
Code of above pattern |
1 21 321 4321 54321 |
5 54 543 5432 54321 |
Code of above pattern |
Code of above pattern |
1 22 333 4444 55555 |
5 44 333 2222 11111 |
Code of above pattern |
Code of above pattern |
55555 4444 333 22 1 |
11111 2222 333 44 5 |
Code of above pattern |
Code of above pattern |
12345 4321 123 21 1 |
1234567 12345 123 1 |
Code of above pattern |
Code of above pattern |
1 01 101 0101 |
13579 3579 579 79 9 |
Code of above pattern |
Code of above pattern |
1 2 4 1 3 5 2 4 6 8 1 3 5 7 9 |
55555 45555 34555 23455 12345 |
Code of above pattern |
Code of above pattern |
1 23 456 78910 |
1 10 101 1010 10101 |
Code of above pattern |
Code of above pattern |
1 2 6 3 7 10 4 8 11 13 5 9 12 14 15 |
1 123 12345 1234567 |
Code of above pattern |
Code of above pattern |
12344321 123**321 12****21 1******1 |
1 2 3 4 5 6 7 8 9 |
Code of above pattern |
Code of above pattern |
1 2 3 4 5 6 7 8 9 10 36 37 38 39 40 41 42 43 44 11 35 64 65 66 67 68 69 70 45 12 34 63 84 85 86 87 88 71 46 13 33 62 83 96 97 98 89 72 47 14 32 61 82 95 100 99 90 73 48 15 31 60 81 94 93 92 91 74 49 16 30 59 80 79 78 77 76 75 50 17 29 58 57 56 55 54 53 52 51 18 28 27 26 25 24 23 22 21 20 19 | |
Code of above pattern |
|
11111 2222 333 22 1 |
5432* 543*1 54*21 5*321 *4321 |
Code of above pattern |
Code of above pattern |
1 121 12321 1234321 |
0 909 89098 7890987 678909876 56789098765 4567890987654 345678909876543 23456789098765432 1234567890987654321 |
Code of above pattern |
Code of above pattern |
1 1 12 21 123 321 1234 4321 1234554321 |
1 21 321 4321 54321 |
Code of above pattern |
Code of above pattern |
1 232 45654 78910987 |
1 2*2 3*3*3 4*4*4*4 4*4*4*4 3*3*3 2*2 1 |
Code of above pattern |
Code of above pattern |
11 12 13 13 14 15 14 15 16 17 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Code of above pattern |
Code of above pattern |
5 54 543 5432 54321 |
1 212 32123 4321234 |
Code of above pattern |
Code of above pattern |
1 23 345 4567 56789 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Code of above pattern |
Code of above pattern |
1234 2341 3421 4321 |
11111 0000 111 00 1 |
Code of above pattern |
Code of above pattern |
1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 625 |
11111 1 1 1 1 1 1 11111 |
Code of above pattern |
Code of above pattern |
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 |
1 123 12345 1234567 123456789 1234567 12345 123 1 |
Code of above pattern |
Code of above pattern |
*000*000* 0*00*00*0 00*0*0*00 000***000 |
5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 5 5 4 3 3 3 3 3 4 5 5 4 3 2 2 2 3 4 5 5 4 3 2 1 2 3 4 5 5 4 3 2 2 2 3 4 5 5 4 3 3 3 3 3 4 5 5 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 |
Code of above pattern |
Code of above pattern |
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 |
1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 6 12 18 24 30 36 7 14 21 28 35 42 49 8 16 24 32 40 48 56 64 9 18 27 36 45 54 63 72 81 10 20 30 40 50 60 70 80 90 100 |
Code of above pattern |
Code of above pattern |
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 |
11111 10001 10001 10001 11111 |
Code of above pattern |
Code of above pattern |
1 2 3 4 5 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 5 4 3 2 1 |
1 3 2 4 5 6 10 9 8 7 11 12 13 14 15 |
Code of above pattern |
Code of above pattern |
1 232 34543 4567654 567898765 |
1 1 2 2 3 3 4 3 3 2 2 1 1 |
Code of above pattern |
Code of above pattern |
1 2 6 3 7 10 4 8 11 13 5 9 12 14 15 |
1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 4 5 4 3 2 1 |
Code of above pattern |
Code of above pattern |
1 2 2 3 3 4 4 3 3 2 2 1 |
1 2 3 4 5 16 6 15 7 14 8 13 12 11 10 9 |
Code of above pattern |
Code of above pattern |
N=39714 3 9 1 7 4 9 1 7 4 1 7 4 7 4 4 |
|
Code of above pattern |
|
Related Links:
Star Patterns
http://cbasicprogram.blogspot.in/2012/03/star-patterns.html
Alphabet Patterns
http://cbasicprogram.blogspot.in/2013/03/alphabet-patterns.html
Series Programs
http://cbasicprogram.blogspot.in/2013/01/series-program.html
thanks for this one...
ReplyDeleteplease bro i need code for this pattern..
ReplyDelete1
123
12345
1234567
12345
123
1
for(i=1;i<=7;i+=2)
Delete{
for(j=1;j<=i;j++)
printf("%d",j);
printf("\n");
}
for(i=5;i>=1;i-=2)
{
for(j=1;j<=i;j++)
printf("%d",j);
printf("\n");
}
1 5
Delete2 4
3
1 5 8 10
ReplyDelete2 6 9
3 7
4
reply plzzzz!!
for(i=1;i<=4;i++)
Delete{
printf("%d",k=i;);
for(j=4;j>i;j--)
printf("%d",k+=j);
printf("\n");
}
Good logic bro
Delete7 8 9 10
Delete4 5 6
2 3
1
Please send the logic for this pattern
ohhh!!! thanx a lot...
ReplyDeletecan any one tell how to print this patterns ?
ReplyDeleteQ1:
11111
22222
33333
44444
55555
Q2:
12345
12345
12345
12345
11111
Delete22222
33333
44444
55555
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
printf("%d",i);
printf("\n");
}
12345
12345
12345
12345
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
printf("%d",j);
printf("\n");
}
what is logic of pattent
ReplyDelete1234321
123 321
12 21
1 1
void main()
Delete{
int i,j,k;
for(i=4;i>=1;i--)
{
for(j=1;j<=4;j++)
{
if(j<=i)
printf("%d",j);
else
printf(" ");
}
for(j=3;j>=1;j--)
{
if(j<=i)
printf("%d",j);
else
printf(" ");
}
printf("\n");
}
}
a million thanks
DeleteThis comment has been removed by the author.
Deleteplease help me out with this
ReplyDeletez y x w v w x y z
z y x w x y z
z y x y z
z y z
z
void main()
Delete{
int i,j;
clrscr();
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
printf("%c ",123-j);
for(j-=2;j>=1;j--)
printf("%c ",123-j);
printf("\n");
}
getch();
}
How to print this pyramid
ReplyDelete1 2 3 4 5
.4 3 2 1
..1 2 3
....2 1
.....1
this should work, not tested ...
Deletefor(i=5;i>=1;i--)
{
for(j=5;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("%d ",k);
}
printf("\n");
}
it workd..i wantd fr * patrn.. thanx !
DeleteIt works.. thank you
Deleteit works but upto
Delete1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
How to print this
ReplyDeleteABCDEFEDCBA
ABCDE.EDCBA
ABCD…..DCBA
ABC……….CBA
AB……………BA
A……………...A
plzz help!! Dots are spaces …
void main()
Delete{
int i,j,k;
for(i=5;i>=1;i--)
{
for(j=1;j<=5;j++)
{
if(j<=i)
printf("%c",'A' + j-1);
else
printf(" ");
}
for(j=4;j>=1;j--)
{
if(j<=i)
printf("%c",'A' + j-1);
else
printf(" ");
}
printf("\n");
}
}
superb man!!!!!!!!!!!!!!!!
DeleteAwesome thinking man!!!!!!!!
Delete1
ReplyDelete1
2
12
3
123
4
1234 plz help
int main()
Delete{
int i, j;
for(i=1;i<=4;i++)
{
printf("%d\n",i);
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
}
A
ReplyDelete11
BBB
22222
CCCCC
void main()
Delete{
int i, j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
if(i%2==0)
printf("%d",i/2);
else
printf("%c",'A' + i/2);
}
printf("\n");
}
}
Nimish your program works properly..
DeletePls help me.....
ReplyDelete54321
_5432
__543
___54
____5
____5
___45
__345
_2345
12345
_is space....
54321
Delete_5432
__543
___54
____5
main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=5;j>=1;j--)
{
if(j>i)
printf(" ");
else
printf("%d",j);
}
printf("\n");
}
}
____5
Delete___45
__345
_2345
12345
main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=1;j<=5;j++)
{
if(j<i)
printf(" ");
else
printf("%d",j);
}
printf("\n");
}
}
54321
ReplyDelete*4321
**321
***21
****1
12345
*2345
**345
***45
****5
****5
***45
**345
*2345
12345
Pls help me with these programs pls...i need space where * is written.
Thank you
54321
Delete*4321
**321
***21
****1
main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=5;j>=1;j--)
{
if(i<j)
printf(" ");
else
printf("%d",j);
}
printf("\n");
}
}
12345
Delete*2345
**345
***45
****5
main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(j<i)
printf(" ");
else
printf("%d",j);
}
printf("\n");
}
}
****5
Delete***45
**345
*2345
12345
main()
{
int i,j;
for(i=5;i>=1;i--)
{
for(j=1;j<=5;j++)
{
if(j<i)
printf(" ");
else
printf("%d",j);
}
printf("\n");
}
}
i want to print
ReplyDeletec
co
com
comp
compu
comput
compute
computer
please tell me the programme to write the above
thankssssssss
#include
Delete#include
int main()
{
char s[]="computer";
int i,j;
for(i=0;s[i];i++)
{
for(j=0;j<=i;j++)
printf("%c",s[j]);
printf("\n");
}
return 0;
}
sir plzz tellme this program using manipulators in c++
Deletesir can you give me your phone no. or email ID so that i can contact you directly....
ReplyDeletenimishsoft@gmail.com
DeleteWhat is the code for ??
ReplyDelete1 2 3 4 4 3 2 1
1 2 3 3 2 1
1 2 2 1
1 1
void main()
Delete{
int i,j,k;
for(i=4;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
for(j=i;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
}
1
ReplyDelete232
23432
help me for this
printf("1\n");
Deletefor(i=3;i<=4;i++)
{
for(j=2;j<=i;j++)
printf("%d",j);
for(j=i-1;j>=2;j--)
printf("%d",j);
printf("\n");
}
what is program for this?
ReplyDelete*##
#*#
##*
help!
for(i=1;i<=3;i++)
Delete{
for(j=1;j<=3;j++)
{
if(i==j) printf("*");
else printf("#");
}
printf("\n");
}
how this can be code in c
ReplyDelete1*3*5*7
2*4*6
3*11
8*10
13
pls help as soon as possible
not able to get the logic of it :O
Delete*
ReplyDelete*A*
*A*A*
*A*A*A*
help plz.
for(i=1;i<=5;i++)
Delete{
for(j=1;j<=i;j++)
{
if(j%2==0) printf("A");
else printf("*");
}
printf("\n");
}
Please give the solutionof modular program to read n numbers and find divisors of each of them........
ReplyDeletewhat is the programe
ReplyDelete1
23
456
7890
12345
int main()
Delete{
int i,j,k;
k=1;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
if(k==10) k=0;
printf("%d",k++);
}
printf("\n");
}
}
1
ReplyDelete12
121
1212
tweak with http://cbasicprogram.blogspot.in/2012/04/number-pattern-20.html
Deletein inner loop replace
printf("%d",j%2);
with
if (j%2==0)
printf("2");
else
printf("1");
1 2 3 4 5
ReplyDelete16 6
15 7
14 8
13 12 11 10 9
Tweak with this http://cbasicprogram.blogspot.in/2012/05/perfect-square.html
Delete1
ReplyDelete1 4
1 4 9
1 4 9 16
1 4 9 16 25
http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
Deletein above program just change printf("%d",j); to printf("%d",j*j);
how will we print this
ReplyDelete1234
14 5
13 6
12 7
111098
tweak with http://cbasicprogram.blogspot.in/2012/05/perfect-square.html
Delete1 2 3
ReplyDelete4 5
6 7 8 9
10 11 12
13 14
15
Help please!
TIA!
No logical pattern in your question.
Deletewill you please help me this
ReplyDelete1
232
23432
2345432
tweak with http://cbasicprogram.blogspot.in/2012/04/number-pattern-27.html
DeleteThank you very much... :)
ReplyDeleteu helped me a lot..
55555
ReplyDelete55555
45555
34555
23455
12345
how to make it? plzzzz teach me..... what im going to do is a rectangular, so there will be extra one lane compare to it's base...
http://cbasicprogram.blogspot.in/2012/04/number-pattern-18.html
DeletePrint extra line before the loop, or start loop with 6 and if i=6 then print i else rest of the logic
5 5 5 5 5
ReplyDelete5 5
5 5
5 5
5 5 5 5 5
code for this plz.............
use http://cbasicprogram.blogspot.in/2013/01/number-pattern-42.html
Deleteand print 5 instead of 1
1
ReplyDelete3 5
7 9 11
13 15 17 19
21 23 25 27 29
http://cbasicprogram.blogspot.in/2012/04/number-pattern-19.html
Deletejust modify it to increment k by 2 instead of 1
1
ReplyDelete13
135
1357
http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
Deletechange from printf("%d",j);
to printf("%d",(j*2)-1);
plz help me in this
ReplyDelete*****1
****12
***123
**1234
*12345
123456
Just add following loop as first inner loop
Deletehttp://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
for(j=4;j>=i;j--)
{
printf("*");
}
5
ReplyDelete15 5
25 15 5
35 25 15 5
help me plz
http://cbasicprogram.blogspot.in/2012/04/number-pattern-3.html
Deletejust modify printf("%d",j);
to printf("%d ",(j*10)-5);
Its very helpful for me Thanks :)
ReplyDelete@nimish
ReplyDeletedude you are awesome ....so helpful blog !!
keep updating...tc
ya its very usefull for us.......
ReplyDeleteplease write here the solution :
ReplyDelete1
2 5
6 9 14
15 18 23 30
31 34 39 46 57
hit for rows
Delete1 + 1x1 = 2
2 + 2x2 = 6
6 + 3x3 = 15
15 + 4x4 = 31
31 + 5x5 = 56
for columns
add 3,5,7,9...
thanks,this program is very helpful for me.....!!!!!!!
ReplyDelete_ _ 1
ReplyDelete_ 2
3 _ _
_ 4 _
_ _ 5
Sir, Could you Please reply for This Pattern. It would be very helpful sir
Thank u
for(i=1;i<=5;i++)
Delete{
for(j=1;j<=3-i;j++)
printf(" ");
for(j=4;j<=i;j++)
printf(" ");
printf("%d\n",i);
}
please write here the solution :
ReplyDelete1
3 2
4 5 6
10 9 8 7
11 12 13 14
http://cbasicprogram.blogspot.in/2013/01/number-pattern-52.html
Deleteplss i need this to be done.. wap to generate the foll pattern:
ReplyDelete1
232
34543
4567654
567898765
http://cbasicprogram.blogspot.in/2013/01/number-pattern-53.html
Deleteplz give the coding of this in c++
ReplyDelete11
1212
123123
12341234
simply use inner J loop 2 times of http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
DeleteHow to find the sum of following series:-
ReplyDelete(1) + (1+2) + (1+2+3) + (1+2+3+4)....... upto n number of terms
http://cbasicprogram.blogspot.in/2013/01/series-program.html
DeleteHow to find the following sum:-
ReplyDelete1/2 - 2/3 + 3/4 -4/5 + 5/6...... upto n number of terms
http://cbasicprogram.blogspot.in/2013/01/series-program-9.html
Deletefor Series programs please put your comments on Series Programs Page
http://cbasicprogram.blogspot.in/2013/01/series-program.html
it is very useful for me thanks a lot!!!!!
ReplyDelete_ _ _ _ 1_ _ _ _
ReplyDelete_ _ _ 1 2 1_ _ _
_ _ 1 2 3 2 1_ _
_ 1 2 3 4 3 2 1_
1 2 3 4 5 4 3 2 1
What would be the code for this pattern?
(Ignore '_'. Used for indenting)
http://cbasicprogram.blogspot.in/2013/01/number-pattern-56.html
DeletePlease give code for:
ReplyDelete___________1
________2_____2
_____3___________3
_ 4__________________4
_____3___________3
________2_____2
___________1
http://cbasicprogram.blogspot.in/2013/01/number-pattern-57.html
Delete1 2 3 4 5
ReplyDelete16 6
15 7
14 8
13 12 11 10 9
Please tell me how to print above pattern?
http://cbasicprogram.blogspot.com/2013/01/number-pattern-58.html
DeleteWAP to get the sum of series 1+2 pow x+3 pow x+.......+n pow x
ReplyDeleteSir Plz upload Linked list concepts and Programs
ReplyDeleteseries of numbers entered by user the program is to check weather the the user entered in series or not
ReplyDeleteVery Helpful for Freshers.....
ReplyDeletecan anyone tell me the code to print the following structure
ReplyDelete1
3 5
7 9 11
1,2,3,6,9,18,27,54 how to print this series
ReplyDeletehttp://cbasicprogram.blogspot.com/2013/01/series-program-10.html
Deletethnxxx a lot @nimish sir.....its very helpful for me....keep updating sir..and give me your email id for contact ... thnkuuu so much
ReplyDeleteprogram for:
ReplyDelete1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
http://cbasicprogram.blogspot.in/2013/01/pascal-triangle.html
Deletehow to display the pattern with a number
ReplyDeleteeg:- N=39714
3 9 1 7 4
9 1 7 4
1 7 4
7 4
4
This web blogspot is best among all I have ever seen you are doing good job nimish bro I got cleared many doutsdouts thanks.
ReplyDeletethanks a lot for this logics . its asome blog for beginers of C
ReplyDeleteThis is one of the vast collections of pattern programming in C!
ReplyDeleteThanks for your work!
thanks a lot for logics ....this blog is very helpful
ReplyDeletethank you for the information, this is very useful
ReplyDeleteWAP to calculate the sum of a given no. 123=1 2 3=6.. Help me in solving this program
ReplyDeleteHey you are doing great job .! kudos to you .
ReplyDeletecan I have your Email id so that i can resolve my stuff on mail
Really helpful...thank you so much.....
ReplyDeletenice blog
ReplyDeleteis there is any simple logic for pattern programs
ReplyDeleteHi Sir I Want To Learning Functions OOP In C++ ;
ReplyDeleteGood logics sir
ReplyDeletehow have you developed good coding skills? can you reply?
ReplyDeletePractice and Practice and more practice :)
DeleteSir can u tell me how to understand a number pattern program
ReplyDeleteSir thanks for ur solutions can u please write the code for below pattern
ReplyDelete1
2 9
3 8 10
4 7 11 14
5 6 12 13 15
hi sir i want coding for this one please help me well the question is printing the matrix in spiral form .
ReplyDelete1 2 3
4 5 6
7 8 9
and the output is 4 5 7 8 9 6 3 2 1
ReplyDeletehi sir i want coding for
1
12
123
1234
12345
hi sir i want coding for
ReplyDelete1
12
123
1234
12345
class pattern
Delete{
public static void main(String args[])
{
int i,j,n;
Scanner sc=new Scanner(System.in);
System.out.println("enter the no:);
n=sc.nextInt();
for(i=0;i<n;i++)
{
for(j=0;j<i;j++)
{
System.out.printin(j+" ");
}
system.out.prin();
}
}
pls answer for this pattern
ReplyDeleten=5;
15 10 6 3 1
14 9 5 2
13 8 4
12 7
11
pls answer for this solution
HELLO SIR CAN YOU PLEASE SEND ME THE CODE FOR:
ReplyDelete1
2 9
3 8 10
4 7 11 14
5 6 12 13 15
HELLO SIR CAN YOU PLEASE SEND ME THE CODE FOR:
ReplyDelete1
2 9
3 8 10
4 7 11 14
5 6 12 13 15
sir, what about this pattern? what's the logic of it?
Delete1
ReplyDelete121
12321
121
1
sir please help me..
ReplyDeleteinput=6
0utput=
1 2 3 4 5 6
13 14 15 16 17 18
25 26 27 28 29 30
31 32 33 34 35 36
19 20 21 22 23 24
7 8 9 10 11 12
sir please help me..
ReplyDeleteinput=6
0utput=
1 2 3 4 5 6
13 14 15 16 17 18
25 26 27 28 29 30
31 32 33 34 35 36
19 20 21 22 23 24
7 8 9 10 11 12
can any one tell how to print this sequence
ReplyDelete1
12
123
1234
12345
----5
ReplyDelete---454
--34543
-2345432
123454321
where - is a space
Create A Flowchart That Will Print The Number From High To Low And Vice Versa.
ReplyDeleteSample Output: 5
55555
4444
333
22
1
1
22
333
4444
55555
1
ReplyDelete121
12321
121
1
Check out this for pattern printing in C https://www.programmingponds.com/2018/08/program-in-c-to-print-different-types.html
ReplyDelete#include
ReplyDeleteint main()
{
int i, j;
int n=6;
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
return 0;
}
I need code of this
ReplyDelete333
414
525
636
333
1=1
ReplyDelete1+2=3
1+2+3=6
1+2+3+4=10
1+2+3+4+5=15
can anyone tell code for this
for n=4
ReplyDelete1 2 3 4
9 10 11 12
13 14 15 16
5 6 7 8
please give the short and effective logic for this
Code for above output
ReplyDelete1*2*3*10*11*12
4*5*8*9
6*7
pattern :
ReplyDelete1
2 4
3 5 7
6 8
9
please someone explain logic for the above pattern.
Can I have code for below pattern
ReplyDelete1
2*3
4*5*6
7*8*9*10
7*8*9*10
4*5*6
2*3
1
This comment has been removed by the author.
Delete#include
Delete#include
int main()
{
int n,i,temp,j,k=1,l,m;
scanf("%d",&n);
for(i=1 ; i<=n; i++)
{
for(j=1 ; j<=i ; j++)
{
printf("%d ",k);
k++;
if(i!=j)
printf("*");
}
printf("\n");
}
k-= n;
temp=k;
for(i=n ; i>=1; i--)
{
for(j=1 ; j<=i ; j++)
{
printf("%d ",temp);
temp++;
if(i!=j)
printf("*");
}
printf("\n");
k-= (i-1);
temp=k;
}
}
ReplyDelete1
2*3
4*5*6
7*8*9*10
7*8*9*10
4*5*6
2*3
1
#include
void print(int n)
{
for(int i = 1; i <= n; i++)
{
for(int j = 1; j < i+1; j++)
{
if(j < i)
{
printf("%d*",i);
}
else
{
printf("%d ",i);
}
}
printf("\n");
}
for(int i = n; i >= 1; i--)
{
for(int j = 1; j < i+1; j++)
{
if(j < i)
{
printf("%d*",i);
}
else
{
printf("%d ",i);
}
}
printf("\n");
}
}
int main()
{
int n;
scanf("%d",&n);
print(n);
return 0;
}
1*2*3
ReplyDelete*4*5
*6*
7*
8
1
ReplyDelete2 9
3 8 10
4 7 11 14
5 6 12 13 15
Please solve this and explain the logic.
input 3 output 123
ReplyDelete234
345
input 3 output 123
ReplyDelete234
345
3
ReplyDelete123
234
345
#include
int main() {
//code
int i,j,n,k,t=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
t++;
k=t;
for(j=1;j<=n;j++)
{
printf("%d",k);
k++;
}
printf("\n");
}
return 0;
}
This comment has been removed by the author.
ReplyDeleteNeed code
Delete____1
___23
__345
how to print
ReplyDelete1
141
14941
how to print 0
ReplyDelete12
345
6789
Using two variables I,j only
.
how to print
ReplyDelete1
2 7
3 6 8
4 5 9 10
how to print
ReplyDelete1 2 3 4
9 10 11 12
13 14 15 16
5 6 7 8
4
Delete1 2 3 4
9 10 11 12
13 14 15 16
5 6 7 8
CODE:
#include
void print(int n)
{
int i,j;
int k=1;
int m[n][n];
for(i = 0; i < n; i++)
{
for(j = 0; j < n;j++)
{
m[i][j] = k++;
}
}
for(i = 0; i < n; i++)
{
for(j = 0; j < n;j++)
{
if(i%2 == 0)
{
printf("%d ",m[i][j]);
}
}
printf("\n");
}
for(i = n-1;i >= 0;i--)
{
for(j = 0; j < n; j++)
{
if(i%2 != 0)
printf("%d ",m[i][j]);
}
printf("\n");
}
}
int main()
{
int n;
scanf("%d",&n);
print(n);
return 0;
}
1 2 3 4
ReplyDelete9 10 11 12
13 14 15 16
5 6 7 8
void print(int n)
{
int i,j;
int k=1;
int m[n][n];
for(i = 0; i < n; i++)
{
for(j = 0; j < n;j++)
{
m[i][j] = k++;
}
}
for(i = 0; i < n; i++)
{
for(j = 0; j < n;j++)
{
if(i%2 == 0)
{
printf("%d ",m[i][j]);
}
}
printf("\n");
}
for(i = n-1;i >= 0;i--)
{
for(j = 0; j < n; j++)
{
if(i%2 != 0)
printf("%d ",m[i][j]);
}
printf("\n");
}
}
int main()
{
int n;
scanf("%d",&n);
print(n);
return 0;
}
Hello Friends,
ReplyDeleteHow to write a code for this program? Please help me...
1
2 15 3
4 5 66 6 7
8 9 10 189 11 12 13
.
.
bro i need this pattern
ReplyDelete1
2 4
1 3 5
2 4 6 8
1 3 5 7 9
2 4 6 8 10
This comment has been removed by the author.
ReplyDeleteI/P:
ReplyDelete6
O/P:
1
2 4
1 3 5
2 4 6 8
1 3 5 7 9
2 4 6 8 10 12
CODE:
#include
int main() {
int n,i,j,k1,k2;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
if(i%2!=0)
{
k1=1;
for(j=0;j<i;j++)
{
printf("%d ",k1);
k1+=2;;
}
}
else
{
k2=2;
for(j=0;j<i;j++)
{
printf("%d ",k2);
k2+=2;
}
}
printf("\n");
}
return 0;
}
1
ReplyDelete2 2
3 3 3
Code for
ReplyDelete1×2××4×17×18×19×20
--5×6×7×14×15×16
---8×9×12×13
----10×11
Pattern
ReplyDelete1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
Please Help--
ReplyDeleteInput : n = 4
Output :
1
3*2
4*5*6
10*9*8*7
int main()
Delete{
int i,j,n,count=0,k=0;
printf("Enter N\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
count=k;
for(j=1;j<=i;j++)
{
if(i%2==0)
{
printf("%d",count+i);
count=count-1;
if(j!=i)
printf("*");
k++;
}
else
{
count=count+1;
printf("%d",count);
if(j!=i)
printf("*");
k++;
}
}
printf("\n");
}
return 0;
}
Write a program for the pattern
ReplyDelete3
5 5
7 7 7
9 9 9 9
11 11 11 11 11
This comment has been removed by the author.
ReplyDelete1
ReplyDelete1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
12345 67890
ReplyDelete1 5 6 0
12345 67890
1 678
1 6 9
how to print this
1*2*3*4*17*18*19*20
ReplyDelete5*6*7*14*15*16
8*9*12*13
10*11
ReplyDelete1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
Anyone do this program please
Early
1 1
ReplyDelete12 21
123 321
1234321
please solve this .
****5
ReplyDelete***44
**333
*2222
11111
1
ReplyDelete1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
i need code for this pattern
ReplyDeleteinput:
1*2*3*4*5
11*12*13*14*15
21*22*23*24*25
16*17*18*19*20
6*7*8*9*10
this is top and bottom alternate pattern program.
Could you help me with this pattern?
ReplyDelete9
579
13579
1357913
Could any one help me in butterfly pattern?
ReplyDeleteIf n= 12
ReplyDelete1 2
1 3 2
1 4 3 5 2
1 5 4 7 3 8 5 7 2
Can anyone tell how to print the following pattern?
ReplyDelete0
10 12
20 22 24
30 32 34 36
print in c pg
ReplyDelete12345
54321
12345
54321
12345
54321
1
ReplyDelete3 1
5 3 1
7 5 3 1
9 7 5 3 1
Hw to print plz
1 2 3 4 5
ReplyDelete2 2 3 4 5
3 3 3 4 5
4 4 4 4 5
5 5 5 5 5
Hw to print plz
Sir please send the code for this pattern
ReplyDelete1
2 9
3 8 10
4 7 11 14
5 6 12 13 15
This comment has been removed by the author.
ReplyDelete