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 / neo

#include <stdio.h>

void div(int n){
int i=2;
while(n%i!=0 && i!=n){
i++;
}
printf("%d ",i);
if(i!=n){
div(n/i);
}

}

main(){
int i;
printf("Enter number:");scanf("%d",&i);
printf("1 ");
div(i);
}

Is This Answer Correct ?    25 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1611


What is pragma c?

1073


Who developed c language and when?

1025


What are the 5 types of inheritance in c ++?

979


What is the difference between array and pointer in c?

1099


What is 1d array in c?

1041


How to set file pointer to beginning c?

1159


How do I create a directory? How do I remove a directory (and its contents)?

1112


Is null always defined as 0(zero)?

1056


Do you know the difference between malloc() and calloc() function?

1016


What is indirection in c?

1034


Why doesnt that code work?

1088


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2275


What is an array in c?

1006


Write a program which returns the first non repetitive character in the string?

1068