logic - WAP in C or java: Consider two char arrays, "abcdefg" and "xyz"...the output must print "axbyczdefg" -


consider 2 char arrays, "abcdefg" , "xyz".

the output must print "axbyczdefg", please i've been stuck on since morning.

#include <stdio.h> #include <conio.h>  void main() {     int i,j;     char a[]="abcdefg";     char b[]="xyz";     for(i=0;i<=6;i++) {         printf("%c",a[i]);         for(j=0;j<=i;j++) {              printf("%c",b[j]);         }      } } 

like this

#include <stdio.h>  int main(void) {     const char *a = "abcdefg";     const char *b = "xyz";      while(*a || *b){         if(*a)             putchar(*a++);         if(*b)             putchar(*b++);     } } 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -