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 do the functions atoi(), itoa() and gcvt() do?

1194


c program for searching a student details among 10 student details

2093


What does sizeof function do?

1199


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

1056


What is wrong with this program statement? void = 10;

1258


How #define works?

1108


define string ?

1112


Write the control statements in C language

1208


How do shell structures work?

1117


Why do we need functions in c?

1024


What is indirection? How many levels of pointers can you have?

1146


Explain high-order and low-order bytes.

1103


What is "Duff's Device"?

1170


What is an array in c?

1053


#include #include struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

6318