C program for diviser, C/C++ Programming


C Program for DIVISER

 

void main()

{

          int result,number,min;

          clrscr();

          printf("ENTER THE NUMBER=");

          flushall();

          scanf("%d",&number);

          min=1;

          while (min<=number)

          {

                   result=number%min;

                   if(result==0)

                   {

                             printf("THE NUMBER IS DIVISIBLE BY=%d\n",min);

                   }

                   min=min+1;

          }

          getch();

}

OUTPUT :

 ENTER THE NO: 10

THE NO IS DIVISIBLE BY : 1

THE NO IS DIVISIBLE BY : 2

THE NO IS DIVISIBLE BY : 5

THE NO IS DIVISIBLE BY : 10

 

Posted Date: 9/10/2012 2:23:15 AM | Location : United States







Related Discussions:- C program for diviser, Assignment Help, Ask Question on C program for diviser, Get Answer, Expert's Help, C program for diviser Discussions

Write discussion on C program for diviser
Your posts are moderated
Related Questions
C Program for SWAPPING THE STRING #include conio.h> #include stdio.h> void main() {           char a[50],temp=0;           int i=0,c=0,c1=0,l=0;           clr

1.jewels can only be removed for polishing from either end of the necklace. 2.cost of polishing=sitting number*colour value of jewels.

A function REPAT is specified below. Function REPAT(c in Char, i in Int, s in mString) return in mString pre 1 ≤ i ≤ the length of s. post The returned value is a string identic

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Molecular dynamics for a Lennard-Jones system (in C++) 1. Write a function which reads in the input variables of a molecular dynamics simulation of a Lennard-Jones system. The inpu

Describe the “placement new" and why would I use it?

The goto statement This statement can be used to branch to another statement of the program. This is rarely used as it violates the principle of structured programming. Though

Write a program that finds the minimum total number of shelv, C/C++ Programming

Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl

Return by reference: The return value of the function must be an address variable.  In following program the function returns the value of x or y and their types are declare