Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/ #include <stdio.h> int main() { int N,a; scanf("%d",&N); for(a=1;a<=N;a++) { if(N%a==0) printf("%d\n",a); } return 0; }
#include
ReplyDeleteint main()
{
int i,n;
float x;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
x=n%i;
if(x==0)
{
printf("%d\n",i);
continue;
}
else
continue;
}
return 0;
}
reply....