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


Please Help Members By Posting Answers For Below Questions

What is the ANSI C Standard?

1019


What does it mean when a pointer is used in an if statement?

872


Why isnt there a numbered, multi-level break statement to break out

830


Is fortran still used today?

816


Write a program to check palindrome number in c programming?

795


What is an lvalue?

849


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3279


If the size of int data type is two bytes, what is the range of signed int data type?

805


Differentiate between new and malloc(), delete and free() ?

915


How can I copy just a portion of a string?

1080


What is an expression?

850


pierrot's divisor program using c or c++ code

1980


What is the size of structure in c?

916


4. main() { int c=- -2; printf("c=%d",c); }

1578


why do some people write if(0 == x) instead of if(x == 0)?

847