Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa IDE-Questions finding divisors of a number

Have Programming Question? Ask it here!
 
 
 


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


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


Advertisement
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



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
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
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 Lost Frames - Java tutorial
Finding Lost Frames 2001-05-10 The Java Specialists' Newsletter [Issue 019] - Finding Lost Frames Author: Dr. Heinz M. Kabutz If you are reading... fact to the Politburo, but perhaps I've read too many spy stories. Finding
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
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
Doclet for finding missing comments - Java Tutorials
Doclet for finding missing comments 2002-06-05 The Java Specialists' Newsletter [Issue 049] - Doclet for finding missing comments Author: Dr. Heinz M... a Java specialist, especially if it can be done remotely. Doclet for finding
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
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
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
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
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 the eigenvalues and eigenvector of n*n matrix in java
finding the eigenvalues and eigenvector of n*n matrix in java  Here...[][] {{4,3,1,2},{1,1,1,1},{1,2,1,1},{1,1,1,1} }; double t, c, s; int p, q, icount... icmax = 10; // the maximum iterations number int[] colRowOfElMax = new int[size
Finding Average in JSP
Finding Average in JSP      ... number of elements.   The code of the program is given below:       <HTML> <HEAD> <TITLE>Finding
Finding the longest word in a user given string
Finding the longest word in a user given string  In java, accept a string from the user and find the longest word in it.   The given code finds the longest word from the string. import java.util.*; class LongestWord
how to write a function to print for finding the longest palindrome in the given string
how to write a function to print for finding the longest palindrome in the given string  how to write a function to print for finding the longest palindrome in the given string
Example for Finding the Root Element in the XML File
Example for Finding the Root Element in the XML File In this tutorial, we will discuss about how to find the Root Element in the XML file. The XML DOM views an XML document as a tree-structure. Contents can be updated or deleted. You
Using JSTL For Finding Square
Using JSTL For Finding Square          In this program we... are taking to finding out the square is the JSTL.  We are using the <c
buzz number
buzz number  buzz number
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  to check wethere given number is prime or not?  ... { static boolean isPrime(int number){ boolean isPrime=false; int i=(int) Math.ceil(Math.sqrt(number)); while (i>1
prime number
prime number  HI!I want a java program that accepts a number from user and displays whether it is a prime number or not using BufferedReader
Count number of "*"
Count number of "*"  I have this code to count the number of * from a string entered. but I need to find it from an text file. Any idea? import...++; } } System.out.println("The number of vowels in the given sentence
Finding start and end index of string using Regular expression
Finding start and end index of string using Regular expression... the way for finding start and end index of the string using regular expression. For this we are going to make program named Finding_index.java. The steps involved
Number Pyramid
Number Pyramid  Hi Everyone, Can someone help me write the code for the following number pyramid: print... 0 0 0 0 4 ... "); There is 5 spaces in between each number
number sorting
number sorting  program to sort a list of numbers in descending order where the inputs are entered from keyboard in runtime   Hi Friend, Try the following code: import java.util.*; class SortListInDescendingOrder
random number
random number   Please How do I generate a program that gives me random integer from 115 to 250? Using java.util.random. Thank you very much!   Hi Friend, Try the following code: import java.util.*; public final
number pyramid
number pyramid   how to get the code for the following : 1 123 12345 1234567   class Pyramid{ public static void main(String args[]){ for(int i=1;i<=7
Primary number
Primary number  write a program to find the 100th or nth primary number?   import java.util.*; class PrimeNumber{ public static void main(String a[]) { Scanner input=new Scanner(System.in
Primary number
Primary number  write a program to find the 100th or nth primary number?   import java.util.*; class PrimeNumber{ public static void main(String a[]) { Scanner input=new Scanner(System.in
Finding MAX value from emp_id column using SQL query?
Finding MAX value from emp_id column using SQL query?  I need to select maximum of the Emp_id values from SQL server 2005 table.I was using... please tell me SQL query for finding max value in Emp id column.Thanx. MY sql
finding the ip address of other system and store in the database - JDBC
finding the ip address of other system and store in the database  code to find the ip address,host name and their locale of other system that are connect to our system and store all these field or some of the fields
VoIP Number
VoIP Number VoIP Numbers With a VoIPtalk Incoming number, callers can reach you by calling a UK number no matter where you are, Simply plug... connection and anyone can reach you by dialling your individual number. The VoIPtalk
to read number from user
to read number from user  1)print the positive equivalent of the number 2) check if the no is integer or not 3) find the square root of the number 4) find the cube of the number
 

 

 

DMCA.com