Sunday, 18 August 2013

String using write ♥♥♥

#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
    clrscr();
    char *s=" Bhavna";
    int n=strlen(s);
   
    for(int i=1;i<n;i++)
    {
        cout.write(s,i);
        cout<<"\n";
    }
    for(i=n;i>0;i--)
    {
        cout.write(s,i);
        cout<<"\n";
    }
    getch();
}

Here Is The Output :)


No comments:

Post a Comment