Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Tuesday, January 05, 2016

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

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

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:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List