diff --git a/program-1/a.out b/program-1/a.out new file mode 100755 index 00000000..3448b52e Binary files /dev/null and b/program-1/a.out differ diff --git a/program-23/a.out b/program-23/a.out new file mode 100755 index 00000000..99981a39 Binary files /dev/null and b/program-23/a.out differ diff --git a/program-23/program.c b/program-23/program.c new file mode 100644 index 00000000..b78c8f62 --- /dev/null +++ b/program-23/program.c @@ -0,0 +1,13 @@ +#include +int main() +{ + int n,count=0; + printf("Enter the number\n"); + scanf("%d",&n); + while(n!=0) + { + count++; + n/=10; + } +printf("number of digits =%d\n",count); +} \ No newline at end of file diff --git a/program-24/a.out b/program-24/a.out new file mode 100755 index 00000000..d8f80262 Binary files /dev/null and b/program-24/a.out differ diff --git a/program-24/program.c b/program-24/program.c new file mode 100644 index 00000000..f068ced1 --- /dev/null +++ b/program-24/program.c @@ -0,0 +1,15 @@ +#include +int main() +{ + int i,j,r,c; + printf("Enter the number of rows and columns\n"); + scanf("%d%d",&r,&c); + for(i=0;i +int main() +{ + int i,j,r; + printf("Enter the number of rows\n"); + scanf("%d",&r); + for(i=0;i +int main() +{ + /*initialization */ + int n,i,j,count=0; + printf("enter the number of rows\n"); /*Input the number of rows */ + scanf("%d",&n); + for(i=1;i<=n;i++) /*condition */ + { + for(j=1;j<=i;j++) + { + printf("\t%d",count++); /*output */ + } + printf("\n"); + }return 0; +} \ No newline at end of file diff --git a/program-27/a.out b/program-27/a.out new file mode 100755 index 00000000..447dbe46 Binary files /dev/null and b/program-27/a.out differ diff --git a/program-27/program.c b/program-27/program.c new file mode 100644 index 00000000..67fe076c --- /dev/null +++ b/program-27/program.c @@ -0,0 +1,23 @@ +#include +int main() +{ + int i,j,r; + printf("Enter the number of rows\n"); + scanf("%d",&r); + for(i=0;i0;i--) + { + for(j=i;j>0;j--) + { + printf("\t*"); + } + printf("\n"); + } +} \ No newline at end of file diff --git a/program-28/a.out b/program-28/a.out new file mode 100755 index 00000000..b78b3ff4 Binary files /dev/null and b/program-28/a.out differ diff --git a/program-28/program.c b/program-28/program.c new file mode 100644 index 00000000..47414529 --- /dev/null +++ b/program-28/program.c @@ -0,0 +1,16 @@ +#include +int main() +{ + /*initialization */ + int n,i,j; + printf("enter the number of rows\n"); /*Input the number of rows */ + scanf("%d",&n); + for(i=n;i>0;i--) /*condition */ + { + for(j=i;j>0;j--) + { + printf("\t*"); /*output */ + } + printf("\n"); + }return 0; +} \ No newline at end of file diff --git a/program-29/a.out b/program-29/a.out new file mode 100755 index 00000000..fa643187 Binary files /dev/null and b/program-29/a.out differ diff --git a/program-29/program.c b/program-29/program.c new file mode 100644 index 00000000..ad8fb79f --- /dev/null +++ b/program-29/program.c @@ -0,0 +1,24 @@ +#include +int main() +{ + int i,j,r; + printf("Enter the number of rows\n"); + scanf("%d",&r); + for(i=0;i0;i--) + {int x=0; + for(j=i;j>0;j--) + { + + printf("\t%d",x++); + } + printf("\n"); + } +} \ No newline at end of file diff --git a/program-30/a.out b/program-30/a.out new file mode 100755 index 00000000..db007813 Binary files /dev/null and b/program-30/a.out differ diff --git a/program-30/program.c b/program-30/program.c new file mode 100644 index 00000000..0d0b9830 --- /dev/null +++ b/program-30/program.c @@ -0,0 +1,22 @@ +#include +int main() +{ + int i, space, rows, k=0; + printf("Enter number of rows: "); + scanf("%d",&rows); + for(i=1; i<=rows; ++i, k=0) + { + for(space=1; space<=rows-i; ++space) + { + printf(" "); + } + while(k != 2*i-1) + { + printf("* "); + ++k; + } + printf("\n"); + } + + return 0; +} \ No newline at end of file