Find Factor Of Any Number
#include<stdio.h>
int main()
{
//no को declare और f=1 को declare and initialise कीजिए
int no,f=1;
//no variable में एक नंबर रखिए
printf("Enter any number\n");
scanf("%d",&no);
printf("Factor is given below\n");
for(int i=1;i<=no;i++)
{
/*जो i की value 1 से लेकर
no-variable तक no-variable को पूरी
तरह काट दें,वो no variable का factor hoga.*/
if(no%i==0)
//उसी i value को प्रिंट करवाइए
printf("%d ",i);
}
}
/*Enter any number
12
Factor is given below
1 2 3 4 6 12
[Process completed - press Enter]*/
Comments
Post a Comment