Assign integer value to pointer?

C
int main(){
    int variable;
    int *ptr = &variable;
    *ptr = 20;
    printf("%d", *ptr);
    return 0;
}
Source

Also in C: