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

Differentiate between static and dynamic modeling.

1093


How do I use void main?

1089


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

1124


What is file in c language?

998


What are the different types of objects used in c?

1023


Is main an identifier in c?

1141


What does %c do in c?

979


What is a shell structure examples?

1089


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

1104


Are negative numbers true in c?

1054


How can a number be converted to a string?

1317


What does the characters “r” and “w” mean when writing programs that will make use of files?

1468


State the difference between x3 and x[3].

1109


Explain about the functions strcat() and strcmp()?

1044


Explain how do you print an address?

1140