c++ string program
#include<iostream.h>
#include<string.h>
int main()
{
char str[]="INDICODERZ";
int len=strlen(str);
int i,j;
for (i=0; i<len; i++)
{
for (j=0; j<len; j++)
{
if (i==len/2)
cout<<str[j]<<" ";
else if (j==len/2)
cout<<str[i]<<" ";
else
cout<<" ";
}
cout<<endl;
}
return 0;
}
Thank you for this code
ReplyDeleteWelcome
DeletePost a Comment