Well, the program is not very long, so I suppose I can simply post it in its entirety. Please bear with me; this is my first time using code tags, and I am not entirely sure that I am posting correctly.
The intent of the program is to take the scanned number, q, and print its prime factors. The problem is apparently occurring in the while loop, which is intended to remove and print each factor.
Code:
#include <stdio.h>
#include <math.h>
main()
{
int d = 1, q, p, e = 0;
float k;
scanf( "%d", &q);
for( d <= (sqrt(p)); ++d;) {
p = q;
k = p / d;
while( round(k) == k) {
e = d;
printf("%d ", e);
p = k;
k = p / d;
}
}
if( p == q )
printf( "%d ", q);
if( p != q && p != 1 )
printf( "%d ", p);
}