C++ Saved Program: majestic-life

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include <iostream>
#include<string>
using namespace std;

int main() {
	int i,j,los,lot;
	char grid[20][20],source, target;
	cout<<"Enter the source and target";
	cin>>source;
	cin>>target;
	los = source.strlen()+2; // source length
	lot = target.strlen()+2; //target length
	grid[0][0] = NULL;
	grid[0][1] = '#';
	for(i=2,j=0;i<los;i++,j++)
	    grid[0][i] = target[j];
	for(i=0;i<los;i++)
	cout<<grid[0][i];
	return 0;
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs