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
what are bit fields? What is the use of bit fields in a structure declaration?
What is "Duff's Device"?
What does the characters “r” and “w” mean when writing programs that will make use of files?
How can I do serial ("comm") port I/O?
what is the different bitween abap and abap-hr?
How was c created?
Why is it that not all header files are declared in every C program?
What is the purpose of & in scanf?
Explain About fork()?
Explain how do you convert strings to numbers in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
What is storage class?
explain what is fifo?
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
What is static and auto variables in c?