# finding divisors of a number

Ads

Share on Google+

ritin sagar
finding divisors of a number
1 Answer(s)      6 years and 11 months ago
Posted in : IDE Questions

write a c program to input a number and print all its divisors using while loop.

Ads
View Answers

November 23, 2010 at 3:05 PM

Hi Friend,

Try the following code:

```#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
ptintf("\n Enter Number: \n");
scanf("%d",&n);
for(i=2;i<=n;i++){
if(n%i==0){
printf("\t %d",i);
n=n/i;
i--;
}
}
getch();
}
```

Thanks

Ads

Related Tutorials/Questions & Answers:
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
Advertisements
finding divisors of a number
finding divisors of a number   write a c program to input a number and print all its divisors using while loop
servlet code for finding the table for given number
servlet code for finding the table for given number  servlet code for finding the table for given number?   Here is a an example that accepts a number from the user and display its multiplication table using servlet. 1
Finding A Date
Finding A Date  My Frequency Start Date is 24-08-2012 My frequency end date - not defined Calculation Frequency is Weekly(Sunday) My calculation will be from 24-08-2012 to the following sunday My question is how to find
finding the prime numbers
finding the prime numbers  Hi, I am a beginner to java and I have problem with the code in finding the prime numbers, can someone tell me about... number is prime or not, follow the link and it will provide you in depth knowledge
Java : Square root of any number
Java : Square root of any number In this section we will write code for finding square root of any number without using system methods. Square root : It is number when we square it, find the specified number. There is simplest way
finding java code on internet
finding java code on internet  Is there anybody to help me? i want to some java coding web sites.it is prerequest for me
prime number
prime number  could u pls help me out in finding whether a number is a prime number or not?   import java.util.*; class CheckPrimeNumber { static boolean isPrime(int number){ boolean isPrime=false
Finding duplicates using array in for loop
Finding duplicates using array in for loop  how to find the duplicates in array using for loop
Finding searching phrase of a search engine
Finding searching phrase of a search engine  how to find out searching phrase of a search engine..? like, if visitors enter the keyword to google, is is any possible to get that keyword
Finding smallest value, then the next etc
Finding smallest value, then the next etc  hi, I know how to search for the smallest value index in an unsorted array so far with this: double currentValue = dist[0]; int smallestIndex = 0; for (int j
Finding page count in any file
Finding page count in any file  Hi, I want to find out the page count in any file (doc,ppt,pdf,image,etc...). Is there any universal API to deal with any file irrespective of the file extension.Its bit urgent. Please let me
Finding shapes in digital photos - java
Finding shapes in digital photos - java  Hello, I need some hints/tips regarding some project I'm doing. The project is about finding shapes in digital photos (JPEG file). Here's what I have to do: A digital photo
perfect number - Java Beginners
perfect number  An integer number is said to be a perfect number.... For example, 6 is a perfect number because 6 = 1+2+3. Write a method perfect that determines if parameter number is a perfect number. Use this method
Check Perfect Number in Java Program
How to Check Perfect Number in Java Program A perfect number is a positive integer where the sum of all its positive divisors, except itself, is equal to the number itself. For example 6 is a perfect number as 1,2 and3 are its divisors
Location finding error - JSP-Servlet
Location finding error  Location needs from drive name: My file uploading program has an error. It requires the location should be given from the directory name. Instead of this if only parent directory is given it shows
Finding memory consuming process - Java Beginners
Finding memory consuming process  Hi, While debugging or optimizing your java application, how to find the memory consuming processes? Thanks
Finding all palindrome prime numbers - Java Beginners
Finding all palindrome prime numbers  How do i write a program to Find all palindrome prime numbers between two integers supplied as input (start and end points are excluded
buzz number
buzz number  buzz number
i need a java code for finding typemismatch in an editor.
i need a java code for finding typemismatch in an editor.  hi im sriram, i need a java code in such a way that typemismatch code is embedded with the simple java editor. the sample output is shown below !alt text
Finding Average in JSP
Finding Average in JSP      ... number of elements.   The code of the program is given below:       <HTML> <HEAD> <TITLE>Finding
prime number
prime number  get one number and check the number prime or not using if statement   Java Check Prime Number
the number of parameters
the number of parameters  How do I find out the number of parameters passed into function
Number in array
Number in array  How to write a program to check the number that we are entered from keyboard is in the given array
prime number
prime number  check prime number using if statement   Java Check Prime Number
prime number
prime number  check prime number using if statement   Java Check Prime Number
prime number
prime number  To check a number entered by user is prime or not?   Java check prime number import java.util.*; class CheckPrimeNumber { static boolean isPrime(int number){ boolean isPrime=false
prime number
prime number  To check a number entered by user is prime
Armstrong number
Armstrong number  I want java program for Armstrong number
prime number
prime number  write a java program for prime number

Ads

Advertisement null

Ads