Skip to content

Commit

Permalink
Merge pull request #41 from MobinTGR8/Mobin
Browse files Browse the repository at this point in the history
C6 1.c
  • Loading branch information
SharafatKarim authored Dec 20, 2023
2 parents 1c746e9 + bea107f commit 0755274
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions solutions/Mobin/6/1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<stdio.h>
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;
}
19 changes: 19 additions & 0 deletions solutions/Mobin/6/2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>
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;
}

0 comments on commit 0755274

Please sign in to comment.