Answers for "flowchart to display factors of a number"

C++
0

flowchart to display factors of a number

#include<iostream>
using namespace std;
int main() {
   int num = 20, i;
   cout << "The factors of " << num << " are : ";
   for(i=1; i <= num; i++) {
      if (num % i == 0)
      cout << i << " ";
   }
   return 0;
}
Posted by: Guest on December-02-2020

Code answers related to "flowchart to display factors of a number"

Browse Popular Code Answers by Language