Posts

Showing posts with the label how to store multiple string values in an array using c

Array Program #3

Image
6. Read two character arrays from user and concat (concatenate)them one after other in third array and print final array. #include<stdio.h> #include<string.h> void main() {      int i,j;      char a[100],b[100],c[100];      printf("Enter the first string\n");      scanf("%s",a);      printf("Enter the second string\n");      scanf("%s",b);      printf("First string  = %s\n", a);      printf("Second string = %s\n", b);      i=0;      while(a[i]!='\0')      {           c[i]=a[i];           i++;      }      c[i]=' ';      i++;       j=0;    ...