C Programming: Finding Factors Using 'do-while' Loop and User Interaction
#include <stdio.h> int main () { int a , b ; do { // Initialize 'b' to 2 for each iteration of the loop b = 2 ; // Prompt the user to enter a digit printf ( "Enter a digit: \n " ); // Read the input from the user scanf ( " %d " , & a ); // Display message for searching factors printf ( "Searching: \n " ); // Loop to find factors of the entered number while ( a > b ) { if ( a % b == 0 ) { // If 'b' is a factor of 'a', print 'b' and increment 'b' to search for the next factor...