Advertisement
Divyansh_Chourey

proper divisors of a number

Mar 18th, 2024
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | Source Code | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int num;
  4.     printf("Enter the number: ");
  5.     scanf("%d", &num);
  6.     printf("The proper divisors of %d are : ", num);
  7.     for(int i=2; i<num; i++){
  8.         if(num%i == 0){
  9.             printf("\n%d ", i);
  10.         }
  11.     }
  12.    
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement