Question
The Factor of a Given Number Using C-Program
Sample TestCase Expected Output
1. 101 2 5 10
2. 121 2 3 4 6 12
Answer
#include <stdio.h>int main() { int num, i ; scanf("%d", &num); for (i = 1; i <= num; ++i) { if (num % i == 0) { printf("%d ", i); } } return 0;}
Explanation:
What is the factor in math?
Factor, in mathematics, a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly. .This called Factors of a number...
This comment has been removed by a blog administrator.
ReplyDeleteYour blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging.. teknisk analys
ReplyDeleteExcellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. lära sig teknisk analys
ReplyDelete