deallocate memory in c

#include <stdlib.h>

int main() {
    int *ptr;

    // Allocate memory
    ptr = (int)malloc(10  sizeof(int));

    // Use the allocated memory

    // Deallocate memory
    free(ptr);

    return 0;
}