This is the simple C++ logical building program for beginners. The purpose of this type of programming is to give an idea of logical programming for beginners so they can learn programming in efficient ways.
Source Code
#include<iomanip>
#include<iostream>
using namespace std;
int main(void)
{
int space=4;
char Values[7]={'1','2','3','4','5','6','7'};
for(int i=7; i>0; i--)
{
for (int j=0;j<i;j++)
{
cout<<Values[j];
cout<<" ";
}
if(i!=7)
{
cout<<setw(space);
space+=4;
}
for (int k=i;k>=0;k--)
{
cout<<Values[k];
cout<<" ";
}
cout<<endl;
}
system("pause");
return 0;
}
Output of the Program
Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.
C++, C Plus Plus, Programlama
ReplyDelete