YouTip LogoYouTip

C Examples Factors Number

# C Language Example - Find All Factors of an Integer [![Image 3: C Language Examples](#) C Language Examples](#) If a*b=c (where a, b, and c are all integers), then we call a and b the factors of c. ## Example #includeint main(){int number, i; printf("Enter an 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; } Output: Enter an integer: 60 Factors of 60 are: 1 2 3 4 5 6 10 12 15 20 30 60 [![Image 4: C Language Examples](#) C Language Examples](#)
← C Examples Binary Decimal ConvC Examples Power Number β†’