Created
October 14, 2024 14:29
-
-
Save realyukii/7408b8ec746c0fbb797ff3477b5dc03f to your computer and use it in GitHub Desktop.
Revisions
-
realyukii created this gist
Oct 14, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #include <stdio.h> /* * A program to demonstrate inclusion principle in set theory. * note: to change the parameter, you need to manually adjust the condition. * * */ int main(void) { int start = 1; int end = 100; int result = 0; int range = 0; for (int i = start; i <= end; i++) { range++; if (i%5 == 0 || i%3 == 0) { printf("i = %d\n", i); result++; } } printf("range: %d\n", range); printf("the cardinality of set or collection of A where the elements is smth that can be divided either by 5 or 3 in between of %d to %d is %d\n", start, end, result); return result; }