Write a program that reads a real number on the keyboard without telling the user to enter a value and then displays its integer part on the screen and then go to a new line.


Difficulty level
This exercise is mostly suitable for students
#include <stdio.h>

int main()
{
    double x;
    scanf("%lf",&x);
    
    printf("%d\n",(int)x);

    return 0;
}

Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Comb left binary trees