write an interactive program to generate the divisors of a
given integer.
Answer Posted / dally
#include<stdio.h>
int main()
{
int n,i=1;
printf("Value for n\n");
scanf("%d\n",&n);
while(i<=n)
{
if(n%i == 0)
printf("%d\n",i);
i++;
}
}
| Is This Answer Correct ? | 8 Yes | 5 No |
Post New Answer View All Answers
What is a structural principle?
What is the advantage of using #define to declare a constant?
Explain what does a function declared as pascal do differently?
What is the difference between %d and %i?
What's the difference between constant char *p and char * constant p?
is it possible to create your own header files?
how is the examination pattern?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
What is the use of gets and puts?
What does != Mean in c?
Is javascript based on c?
what is uses of .net
What is the size of array float a(10)?
What is the maximum length of an identifier?
What is the size of a union variable?