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


Please Help Members By Posting Answers For Below Questions

Differentiate between ordinary variable and pointer in c.

870


What is unsigned int in c?

757


In C language, a variable name cannot contain?

1023


How to write c functions that modify head pointer of a linked list?

761


What are the types of variables in c?

790


What is the scope of global variable in c?

773


#include { printf("Hello"); } how compile time affects when we add additional header file .

1678


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1514


Why are all header files not declared in every c program?

832


What is the use of pointers in C?

844


What are the advantages of Macro over function?

1636


Explain the difference between strcpy() and memcpy() function?

791


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

1578


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

864


what is the role you expect in software industry?

1893