write an interactive program to generate the divisors of a
given integer.
Answer Posted / tamil
void div(int n){
static int i=1;
while(i<=n){
if(!(n%i))printf(" %d",i);
i++;
}
}
main(){
int i;
clrscr();
printf("Enter number:");scanf("%d",&i);
div(i);
getch();
}
Is This Answer Correct ? | 11 Yes | 9 No |
Post New Answer View All Answers
What is the ANSI C Standard?
What does it mean when a pointer is used in an if statement?
Why isnt there a numbered, multi-level break statement to break out
Is fortran still used today?
Write a program to check palindrome number in c programming?
What is an lvalue?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
If the size of int data type is two bytes, what is the range of signed int data type?
Differentiate between new and malloc(), delete and free() ?
How can I copy just a portion of a string?
What is an expression?
pierrot's divisor program using c or c++ code
What is the size of structure in c?
4. main() { int c=- -2; printf("c=%d",c); }
why do some people write if(0 == x) instead of if(x == 0)?