scanf("%d %d %d",&n,&a,&k);
Your code can be displayed much more nicely, including showing the characters that are misinterpreted as format commands above, by highlighting it in the editor and pressing the code format button in the editor toolbar:
This indents the whole block to allow interpretation as literal text, including preserving code indents.
You could also link to the code, as there for example using
On the actual coding issue, you should re-read the output requirements. The request is for the numerator and denominator of a fraction that evaluates exactly to the angle in question, which may be non-integer. If the request had been for the angle directly to some precision, you should have had