Saturday 18 April 2015

| Logical C++ Programs Asked in Interviews | C++ / C Language Logical Programs | Simple Logical C programs | C Logical Programs with Answers | Logical C Programs

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

 logical c programs asked in interviews

Share it Please
asad

About Author!

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.

1 comments: Post Yours! Read Comment Policy!▼
Important Note:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.