write an interactive program to generate the divisors of a
given integer.
Answer Posted / neo
#include <stdio.h>
void div(int n){
int i=2;
while(n%i!=0 && i!=n){
i++;
}
printf("%d ",i);
if(i!=n){
div(n/i);
}
}
main(){
int i;
printf("Enter number:");scanf("%d",&i);
printf("1 ");
div(i);
}
| Is This Answer Correct ? | 25 Yes | 11 No |
Post New Answer View All Answers
What are data structures in c and how to use them?
What is #define used for in c?
What is substring in c?
What is the purpose of void in c?
What is adt in c programming?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What is the time and space complexities of merge sort and when is it preferred over quick sort?
Why c is procedure oriented?
What is unary operator?
Explain how can type-insensitive macros be created?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What kind of structure is a house?
What would be an example of a structure analogous to structure c?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.