read a number & print all its devisors using c-program?

Answer Posted / karna

//all devisors of a number
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
printf("Enter the number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if((n%i)==0)
{
printf("%d\n",i);
}
else;
}
getch();
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are bit fields? What is the use of bit fields in a structure declaration?

1773


What is "Duff's Device"?

905


What does the characters “r” and “w” mean when writing programs that will make use of files?

1181


How can I do serial ("comm") port I/O?

921


what is the different bitween abap and abap-hr?

1934


How was c created?

804


Why is it that not all header files are declared in every C program?

900


What is the purpose of & in scanf?

838


Explain About fork()?

843


Explain how do you convert strings to numbers in c?

826


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16044


What is storage class?

850


explain what is fifo?

832


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

911


What is static and auto variables in c?

788