Program 260: Program to print String in X Pattern(Reverse) in C
//Coming Soon
Output:
#include<stdio.h> #include<string.h> main() { int len,i,j; char str[100]; printf("Enter a string to get X Pattern\n"); gets(str); strrev(str); len=strlen(str); for(i=0;i<len;i++) { for(j=0;j<len;j++) { if(i==j || i+j==len-1) { printf("%c",str[i]); } else{ printf(" "); } } printf("\n"); } }Explanation:
//Coming Soon
Output: