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

Write a progarm to find the length of string using switch case?

1882


Is exit(status) truly equivalent to returning the same status from main?

861


Sir i need notes for structure,functions,pointers in c language can you help me please

2210


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2277


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

955


What is "Hungarian Notation"?

870


What is a memory leak? How to avoid it?

939


What is operator promotion?

850


Why doesnt long int work?

831


Can the sizeof operator be used to tell the size of an array passed to a function?

885


What are the different data types in C?

981


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

957


What is a wrapper function in c?

879


What is the use of a static variable in c?

824


What are the restrictions of a modulus operator?

903