Search
 
SCRIPT & CODE EXAMPLE
 

C

find factors of a number in c

#include <stdio.h>
int main() {
    int num, i;
    printf("Enter a positive integer: ");
    scanf("%d", &num);
    printf("Factors of %d are: ", num);
    for (i = 1; i <= num; ++i) {
        if (num % i == 0) {
            printf("%d ", i);
        }
    }
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: c string is int 
C :: classification report to excel 
C :: lewis hamilton 
C :: como programar a area de um triangulo em c 
C :: bash check if inside lxc 
C :: c gettimeofday example 
C :: C float division 
C :: tainted love 
C :: c data types 
C :: c printf to string 
C :: addition of two matrix in c 
C :: printf signed char 
C :: armstrong number using function in c 
C :: silicon valley 
C :: arduino millis() 
C :: selection sort in c 
C :: c random array 
C :: how to pass an array of structs as an argument in c 
C :: c program to find the factorial of a number 
C :: callback c++ c 
C :: initialize array c 
C :: int to char in c 
C :: star pattern in c 
C :: Bootstrap textarea from 
C :: enregistrement en c 
C :: how to allocate memory for pointer in c 
C :: recursive in c 
C :: how to change file permissions in C language 
C :: print only last 3 number float in c 
C :: how to read from a file in c 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =