#include<stdio.h>
#include<conio.h>
void main()
{
char a[25],b[25];
int i, j, k=1;
puts("Enter the string A");
gets(a);fflush(stdin);
puts("Enter the string B");
gets(b);fflush(stdin);
while(k<2){
for(i=0;i<25;i++)
{
if(a[i]!='\0')
{printf("%c",a[i]);
}
}
for(j=0;j<25;j++)
{
if(b[j]!='\0')
{
printf("%c",b[j]);
}
}k++;
}
getch();
}
The program is about concatenating two string , the program successfully concatenates the strings but also prints some garbage value after the two string why so?