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 meant by keywords in c?

883


What is the use of extern in c?

877


Explain what are reserved words?

884


What does p mean in physics?

837


What is infinite loop?

872


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1520


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

951


What are the 5 data types?

827


largest Of three Number using without if condition?

1311


Explain indirection?

915


The difference between printf and fprintf is ?

1004


What is pass by value in c?

827


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

1997


Why is c known as a mother language?

1006


Why c is called a middle level language?

861