Q:

Reallocating the size of the array by exceeding the limit of it

I cannot solve the issue.  The program has to increase the size of array by the desire of the user.  However, it skips the conditions and starts showing the array itself.  
int main() {
    int *ptr;
    int limit;
    int sum = 0;
    int ans;

    printf("enter the limit of the array\n");
    scanf_s("%d", &limit);
    ptr = (int *)malloc(limit * sizeof(int));
    for (int i = 0; i < limit; i++) {
        printf("enter element %d : ", i + 1);
        scanf_s("%d", (ptr + i));
        if (i = limit) {
            printf("do you want to stop entering?\n");
            printf("\t\t1\t0\n");
            if (scanf_s("%d", &ans) == '1') {
                break;
            } else
            if (scanf_s("%d", &ans) == '0') {
                limit += 5;
                ptr = (int *)realloc(ptr, limit * sizeof(int));
                printf("memory re-allocation is completed succesfully!\n");
            }
        }
    }
    for (int i = 0; i < limit; i++) {
        printf("\nthis is your %d. element : %d\n", i + 1, *(ptr + i));
    }
    return EXIT_SUCCESS;
}

A:

The if statement in your code:
if (i = limit)

does not compare i to limit.  Instead, it assigns the value of limit to i then it checks if the result of this expression is non-zero.  If it is, the block is entered, otherwise it will be skipped. 
= is the assignment operator.  Use the equality operator == to compare two operands. 
if (i == limit)

