Hello guys, I have created a program that will display the array in the screen character by character with spaces in between. Now what I need to do is to display it in a diamond like pattern (1 inverted triangle and 1 normal triangle) with the first letter of the array in the middle.
Here's my code for the array:
Code:
#include <iostream.h>
#include <conio.h>
int main()
{
clrscr();
char input[100];
int index,x=33,y=13;
printf("Enter name: ");
gets(input);
for(index = 0; input[index] != '\0'; index++){
gotoxy(x,y);
cout<<input[index];
x+=2;
cout<<" ";
}
getch();
return 0;
}