#include <stdio.
h>
int main()
{
int a;
printf("Press 1 to find divisors of a number:");
printf("\n");
printf("Press 2 to find factorial of a number:");
printf("\n");
printf("Enter your choice:");
scanf("%d",&a);
if(a<1&&a>2)
{
printf("Wrong choice entered:");
}
switch(a)
{
case 1:
int n;
printf("Enter the number whose divisor is to be found:");
scanf("%d",&n);
printf("Divisors of the given number are:");
for(int i=1;i<=n;i++)
{
if(n%i==0)
{
printf(",%d",i);
}
}
break;
case 2:
int x;
int fact=1;
printf("Enter a number whose factorial is to be found:");
scanf("%d",&x);
for(int i=1;i<=x;i++)
{
fact=fact*i;
}
printf("Factoria of given number is : %d",fact);
break;
default:
printf("wrong choice");
break;
}
return 0;
}