From 5c7ca8e3d1d6485e73c81f6acaed208a85af6858 Mon Sep 17 00:00:00 2001 From: ritikalohia <56797604+ritikalohia@users.noreply.github.com> Date: Sun, 20 Oct 2019 09:32:16 -0700 Subject: [PATCH] Create display the factors of number --- display the factors of number | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 display the factors of number diff --git a/display the factors of number b/display the factors of number new file mode 100644 index 0000000..140204e --- /dev/null +++ b/display the factors of number @@ -0,0 +1,19 @@ +#include +int main() +{ + int number, i; + + printf("Enter a positive integer: "); + scanf("%d",&number); + + printf("Factors of %d are: ", number); + for(i=1; i <= number; ++i) + { + if (number%i == 0) + { + printf("%d ",i); + } + } + + return 0; +}