ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C++ >> OOPS
 
 


 

 
 STL interview questions  STL Interview Questions (91)
 OOPS interview questions  OOPS Interview Questions (558)
 C++ General interview questions  C++ General Interview Questions (458)
Question
1234554321
1234  4321
123    321
12      21
1        1
12      21
123    321
1234  4321
1234554321
 Question Submitted By :: OOPS
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
#include <iostream>
using namespace std;

int main()
{

int MAX =5; /*the number to which series needs to
be created*/
int i,j,k;

/* this loop will print first half of the series*/
for (int m = MAX; m >0 ; m-- )
{
cout<<endl;

for( i =0; i<m; i++) /*loop to print start
numbers from 1 to MAX in each line*/
cout<<(i+1);

for( k = 0; k< 2*(MAX-i);k++) /*space which
needs to be printed after the incremented num*/
cout<<" ";

for( j = i ; j>0 ; j--)/* loop to print
decremented num*/
cout<<j;

}

/* this loop will print next half of the series -
duplicate line skipped*/
for ( int n = 2; n <= MAX ; n++ )
{
cout<<endl;
for ( i = 0; i<n ; i++)
cout<<(i+1);

for( k = 0; k< 2*(MAX-i);k++)
cout<<" ";

for( j = i ; j>0 ; j--)
cout<<j;

}

cout<<endl;
}
 
Is This Answer Correct ?    3 Yes 0 No
C++ Coder
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
what do you mean by static member variable?   2
when my application exe is running nad i don't want to create another exe what should i do HCL 2
Why do we use virtual functions?   4
Write pseudo code for push in a stack? emc2 1
Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?   5
What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.   2
What is function overloading?,describe it with the example.   5
What is R T T I ? Ness-Technologies 6
Describe the difference between a Thread and a Process?   10
WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT. HCL 4
what is the definition of incapsulation   2
How is data security provided in Object Oriented languages? ?   5
 
For more OOPS Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com