Tweet
/* Program to print string sequence in C++
C O M P U T E R
C O M P U T E
C O M P U T
C O M P U
C O M P
C O M
C O
C */
#include<iostream>
#include<stdio.h>
#include<string.h>
main()
{
int l,i,j,p=1,s=1,k;
char a[]="COMPUTER";
l=strlen(a);
for(i=l;i>0;i--)
{
for(k=1;k<=s;k++)
std::cout<<" ";
s=s+2;
for(j=0;j<i;j++)
{
std::cout<<" ";
p++;
std::cout<<a[j];
}
std::cout<<"\n";
}
}
Printing String Sequence in C++ (1)
Posted by
LAHAUL SETH
~
Printing String Sequence in C++ (1)
2012-05-01T08:24:00+05:30
LAHAUL SETH
C++
|
cplusplus
|
Comments
Printing String Sequence in C++ (1)
2012-05-01T08:24:00+05:30
LAHAUL SETH
C++
|
cplusplus
|