Pattern programs are programs which give a output with some pattern consist of numbers,letters or stars.
Example pattern outputs are,
User input - N:
for(i=1; i<=N; i++)
{
for(j=N; j>=i; j--)
{
print j value;
}
print new line;
}
This logic will prints the pattern of
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Check with online compiler here.
Example pattern outputs are,
Logic for 54321 5432 543 54 5 pattern.
for(i=1; i<=N; i++)
{
for(j=N; j>=i; j--)
{
print j value;
}
print new line;
}
This logic will prints the pattern of
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Check with online compiler here.
in programming c how to program that results 54321
ReplyDelete54321 5432 543 54 5
DeleteIs this correct
ReplyDelete110%
DeleteCan we write 5 in place of n?
ReplyDeleteObviously yes
DeleteYes we can write
DeleteWhat is ‘J’ ?
ReplyDeleteHow to execute this in console.log();
ReplyDeleteSus
ReplyDelete