-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUygulama-13.c
48 lines (45 loc) · 910 Bytes
/
Uygulama-13.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
#include <stdlib.h>
// 1- Harf Üçgen Algoritması
/*
int main()
{
int i,j;
char input;
char character='A';
printf("Enter a uppercase letter: ");
scanf("%c",&input);
for (i = 1; i <=(input-'A'+1); i++)
{
for (j =1; j <= i; j++)
{
printf("%c",character);
}
character++;
printf("\n");
}
*/
int main()
{
int i,space,rows,j,number=1;
printf("Enter the number of rows: ");
scanf("%d",&rows);
for ( i = 0; i < rows; i++)
{
for (space = 1; space<=rows-i; space++)
{
printf(" ");
}
for (j = 0; j <= i; j++)
{
if (j==0 || i==0)
{
number=1;
}
else
number=number*(i-j+1)/j;
printf("%4d",number);
}
printf("\n");
}
}