0
Can anyone explain why the integer is not printing?
3 Réponses
+ 2
You could cast the float to an int ("cut off decimal part"):
printf(..., (int)ab);
+ 2
There are several issues with your code:
1. Remove conio.h and getch().
conio is compiler specific, outdated and unnecessary. So is its function getch().
2. The main method in c is of type int, not void. It should return an integer.
3. ab is a float, not an int. hence you need to print it with %f, not %d.
+ 1
I got it,
I know that it's a float type but I want to print only '45'
How can I do that?