From f9b4082b0337a14915672dcd31790c1311dabb87 Mon Sep 17 00:00:00 2001 From: MobinTGR8 Date: Wed, 11 Oct 2023 21:18:43 +0600 Subject: [PATCH 1/2] Create 1.c --- solutions/Mobin/6/1.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 solutions/Mobin/6/1.c diff --git a/solutions/Mobin/6/1.c b/solutions/Mobin/6/1.c new file mode 100644 index 0000000..0730d1e --- /dev/null +++ b/solutions/Mobin/6/1.c @@ -0,0 +1,17 @@ +#include +int main() +{ + printf("ID:2102064\n\n"); + int x; + printf("Enter an integer number: "); + scanf("%d", &x); + if(x % 2 == 0) + { + printf("The number is even\n"); + } + if(x % 2 != 0) + { + printf("The number is odd\n"); + } + return 0; +} From bea107f2f400ab00b0005cfd1f158e2af86f19a9 Mon Sep 17 00:00:00 2001 From: MobinTGR8 Date: Wed, 11 Oct 2023 21:46:38 +0600 Subject: [PATCH 2/2] C6 2 --- solutions/Mobin/6/2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 solutions/Mobin/6/2.c diff --git a/solutions/Mobin/6/2.c b/solutions/Mobin/6/2.c new file mode 100644 index 0000000..0e282da --- /dev/null +++ b/solutions/Mobin/6/2.c @@ -0,0 +1,19 @@ +#include +int main() +{ + printf("ID:2102064\n\n"); + int sum = 0, count = 0; + for (int i = 101; i < 200; i++) + { + if (i % 7 == 0) + { + sum += i; + count++; + } + } + + printf("Number of integers divisible by 7: %d\n", count); + printf("Sum of integers divisible by 7: %d\n", sum); + + return 0; +} \ No newline at end of file