Function Main
Declare Integer n
Declare Integer k
Declare Integer r
Output "Insert a number: "
Input n
Assign k = 1
Output "All divisor of the number: "
While k <= n
Assign r = n mod k
If r = 0
Output k
End
Assign k = k + 1
End
End
#include <stdio.h>
int main() {
int n;
int k;
int r;
printf("Insert a number: \n");
scanf("%d", &n);
k = 1;
printf("All divisor of the number: \n");
while (k <= n) {
r = n % k;
if (r == 0) {
printf("%d\n", k);
}
k = k + 1;
}
return 0;
}
I am Md. Anisur Rahman. I have completed Cyber Security for MSCSE at United International University in 2022.I have completed PGDIT from IIT, Jahangirnagar University in 2020. I'm a Head of IT at Programming24 School.
View all posts by Md. Anisur Rahman