Hello, I am new to C and not really sure how to do this. This program extracts and prints the rightmost digit of the integer portion of a float, and I need to convert it but I'm not sure how.
#include <stdio.h>
void main (void)
{
float num;
int rightdigit;
printf("Enter an integral number: ");
scanf("%d", &num);
rightdigit = num % 10;
printf("\nThe right digit is: %d", rightdigit);
}