Skip to content

Commit

Permalink
feat: day 1 for section 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Faelayis committed Sep 14, 2023
1 parent 7d4f848 commit 353f18a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
18 changes: 18 additions & 0 deletions COM-1308/Section-1/14-09-66/1276.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

int main()
{
int i, sum;

for (i = 0; i <= 50; i++)
{
sum = sum + i;
}

printf("sum = %d\n", sum);

printf("\n");
return 0;

// output: 1276
}
19 changes: 19 additions & 0 deletions COM-1308/Section-1/14-09-66/5.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>

int main()
{
int i, j;

for (i = 0; i <= 9; i++)
{
for (j = 1; j < i; j++)
{
printf("*");
}
}

printf("\n");
return 0;

// output: ************************************
}
32 changes: 32 additions & 0 deletions COM-1308/Section-1/14-09-66/6.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <stdio.h>

int main()
{
int input, i, j;

printf("Enter number: ");
scanf("%i", &input);

for (i; i <= input; i++)
{
for (j = 1; j <= i; j++)
{
printf("%d ", j);
}
printf("\n");
}

printf("\n");
return 0;

/* output
Enter number: 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
*/
}

0 comments on commit 353f18a

Please sign in to comment.