Thread: anyone knows..??!!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Registered User
    Join Date
    Oct 2016
    Posts
    3
    Quote Originally Posted by whiteflags View Post
    Can you please post code of your attempt?
    cpp.sh/7z2yt
    Code:
    #include <stdio.h>
    #include <string.h>
    int main()
    {
    		char in[30];
    		char in2[30];
    		char inx;
    		int x,y,z,a,b,c;
    
    		printf ("Input Word : ");
    		scanf("%s",&in);fflush(stdin);
    		printf("Input Word 2 : ");
    		scanf("%s",&in2);fflush(stdin);
    		x=strlen(in);
    		y=strlen(in2);
    		if (x==y)
    		{
    			for (z=0;z<=x || z<=y;z++)
    			{
    				printf("%c %c",in[z],in2[z]);
    				printf("\n");
    			}
    
    		}
    		else
    		{
    			for (z=0,a=0;z<=30,a<=30;z++,a++)
    			{
    				printf("%c %c\n",in[z],in2[a]);
    			}
    		}
    		getchar();
    		return 0;
    }
    Last edited by Salem; 10-24-2016 at 02:08 AM. Reason: Inlined pastebin lazyness

Popular pages Recent additions subscribe to a feed

Tags for this Thread