Pattern using Numbers coderinme

Pattern using Numbers coderinme

Pattern using Numbers coderinme
The given pattern using numbers can be programmed easily using nested loop in C
Note: In the given shape, “x” denotes space before numbers
xxxx 1
xxx 1 2
xx 1 2 3
x 1 2 3 4
1 2 3 4 5
x 1 2 3 4
xx 1 2 3
xxx 1 2
xxxx 1

#include<stdio.h>
int main()
{
int i,j,k;
for(i = 1 ; i <= 5 ; i++)
{
printf("\t");
for( k = 5 ; k != i ; k--)
{
printf(" ");
}
for( j = 1 ; j = 1 ; i--)
{
printf("\t");
for( k = 5 ; k != i ; k--)
{
printf(" ");
}
for( j = 1 ; j <= i ; j++)
{
printf(" %d",j);
}
printf("\n");
}
getch();
return 0;
}

For more programs in C, visit our C Coder Archives

Pattern using Numbers coderinme

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

Leave a reply:

Your email address will not be published.