Warning: mysqli_connect(): (HY000/2002): Connection refused in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 38

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 40

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 41

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 45

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 48

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 49
c program for pattern13 - Get Program Code
Home / C / c program for pattern13

c program for pattern13

 C program for pattern making

       1
     21
  321
4321

Here is given c program for following pattern. In the above pattern we have two triangle one is empty space triangle together with the shown triangle. That’s why we have to put the loop for empty spaces together with the loop for the shown triangle.

ALSO CHECK : Alternate Java program for this pattern

#include<stdio.h>
#include<conio.h> 
void main()
{ 
int i,j,n; 
clrscr(); 
printf("Enter the number of lines for triangle"); 
scanf("%d",&n); 
for(i=1;i<=n;i++) //loop for number of lines in triangle 
{ 
for(j=1;j<=n-i;j++) // loop for spaces printf(" "); 
for(j=i;j>=1;j--) // loop for pattern to be print printf("%d",j); 
printf("\n"); // for next line
}
 getch(); 
}

OUTPUT:

pattern making in c

Check Also

Restrict Mouse Pointer Position C Graphics Program

This C Program will restrict the Mouse Pointer location or to a particular position or x,y ...

Leave a Reply

Your email address will not be published. Required fields are marked *

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.