Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / pradeep

same program as above, optimising it a little bit.

#include<stdio.h>
int main()
{
int n,i=1;
printf("Value for n\n");
scanf("%d\n",&n);
while(i <= n/2)
{
if(n%i == 0)
printf("%d\n",i);

i++;
}
printf("%d\n",n);
}

Is This Answer Correct ?    2 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between scanf and fscanf?

1199


What are reserved words with a programming language?

1055


what are the 10 different models of writing an addition program in C language?

1841


Is return a keyword in c?

1030


Differentiate Source Codes from Object Codes

1481


What is a union?

989


How do c compilers work?

1049


Can a variable be both static and volatile in c?

974


What is file in c language?

964


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1010


Explain the difference between the local variable and global variable in c?

1025


Explain how are 16- and 32-bit numbers stored?

1208


What will be the outcome of the following conditional statement if the value of variable s is 10?

1231


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

958


Once I have used freopen, how can I get the original stdout (or stdin) back?

1030