新生在C语言数组方面遇到问题,急

编写程序,定义两个字符数组存放从键盘输入的两个字符串,将它们连接起来输出(要求:不使用strcat函数。)例如:str1="How do",str2="you do?",结果输出:How do you do?
#include
#include
int main()
{ char a[100],b[100];
int i=0,j=0;
printf("请输入第一个字符串:\n");
gets(a);
printf("请输入第二个字符串:\n");
gets(b);
if(a[i]!='\0')
{
a[i]=a[i];
i++;
}
else
{
a[i+j]=b[j];
j++;
}
printf("则两字符串连接后为:\n");
puts(a);
}
求帮忙改正

供参考:

#include <stdio.h>
#include<string.h>
int main()
{
    char a[100], b[100]; //str1 = "How do", str2 = "you do?"
    int i = 0, j = 0;
    printf("请输入第一个字符串:\n");
    gets(a);
    printf("请输入第二个字符串:\n");
    gets(b);
    
    while (a[i]) //if (a[i] != '\0') 修改
    {
                //a[i] = a[i];   修改
        i++;
    }
    a[i++] = ' '; //修改
    while(b[j])  //else  修改
    {
        a[i + j] = b[j];
        j++;
    }
    a[i + j] = '\0'; //修改
    printf("则两字符串连接后为:\n");
    puts(a);
}

else里面判断一下b的结束,最后给字符串尾巴加'\0'