This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Showing posts with label String Pattern. Show all posts
Showing posts with label String Pattern. Show all posts

Thursday, 25 July 2013

Program to print the String pattern 2

#include<stdio.h>
int main()
{
char *c="ABCDEF";
char *c1="FEDCBA";
int i,j=0;
clrscr();
for(i=6;i>0;i--)
{
printf("%*.*s",i,i,c);
printf("%*.*s\n",i,i,c1+j);
j++;
}
getch();
}


Tuesday, 2 July 2013

Program to print the String pattern 1

#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
char str[100];
int i;
cout<<"Enter the string:";
cin>>str;
for(i=0;i<=strlen(str);i++)
{
cout.write(str,i);
cout<<"\n";
}
getch();
}