To display every possible combination of two words

Given array of strings, display all possible combinations of strings.



Implementation:


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
  char *v[2]={"welcome","sathish"};
  int s=3,i;
  int t;
  for(;s;s--)
  {
    t=s;
    for(i=0;i<2;i++)
    {
      if(t&1)
       printf("%s",*(v+i));
      t>>=1;
    }
    printf("\n");
  }
  return 0;
}