Q:

Why segmentation fault

Following block of code is giving segmentation fault.Please help. 
 #include<stdio.h>
    int main(){
        int testcase,num;
        int i,j,*array;
        scanf("%d",&testcase);
        for(i=0;i<testcase;i++){
            scanf("%d",&num);
            for(j=0;j<num;j++){
                scanf("%d",(array+j));
            }
        }
        i=0;
        for(i=0;*(array+i)!='\0';i++){
            printf("%d",1);
        }
        }

A:

Edit 2
Wanted to put this on top.
I just noticed that your code is kind of weird. When you're reading the numbers, you have a loop over i, but then another loop over j inside - and each iteration you just overwrite the values you already read. This is weird, and I'm not sure what your original intent was. So although the segmentation fault is still caused because of unallocated array, the solution I wrote here isn't the correct one (and I'm not sure what would be the correct solution until I understand what you meant to do)
end of Edit2
array is uninitialized.
It's a pointer pointing to a place in memory, but that place isn't free, So when you write there you write over important stuff and cause segmentation fault.
The best way to solve it in your case is to add
array=malloc(sizeof(int)*testcase);

just after the line where you read testcase, so just after
scanf("%d",&testcase);

Also, if you do that, it's good practice to free that memory once you're done using it. So in your case add 
free(array);

just after you're done printing the whole array
Edit Just noticed you have another bug - at the loop where you're printing the array:
for(i=0;*(array+i)!='\0';i++){

That is bad, bacause you're treating array, which is an array of ints, like it's a string. "normal" arrays don't end in '\0'. Moreover - '\0' is a char, and *(array+i) is an int.
Replace that line with 
for (i=0;i<testcase;i++){

