Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #flowchart #display #factors #number
ADD COMMENT
Topic
Name
4+7 =