write an interactive program to generate the divisors of a
given integer.

Answer Posted / rakesh ranjan

#include<conio.h>
#include<stdio.h>
main()
{
int n,i;
printf("entre the number");
scanf("%d",&n);
for(i=2;i<n;i++)
{
if(n%i==0)
printf("%d\n",i);
}
getch();
}

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should the const modifier be used?

666


What is masking?

648


What is the use of linkage in c language?

625


What is a pointer in c?

696


Explain the difference between malloc() and calloc() in c?

585






What is the use of void pointer and null pointer in c language?

639


How can you convert integers to binary or hexadecimal?

628


What is getch () for?

687


Explain which function in c can be used to append a string to another string?

600


what is different between auto and local static? why should we use local static?

652


Which is an example of a structural homology?

804


What is register variable in c language?

612


what will be the output for the following main() { printf("hi" "hello"); }

9364


Is javascript based on c?

601


How can you increase the size of a dynamically allocated array?

655