:: 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                      
Categories >> Software >> Programming Languages >> C++ >> OOPS


 STL interview questions  STL Interview Questions (90)
 OOPS interview questions  OOPS Interview Questions (554)
 C++ General interview questions  C++ General Interview Questions (458)
1234  4321
123    321
12      21
1        1
12      21
123    321
1234  4321
 Question Submitted By :: Abhishek
I also faced this Question!!     Rank Answer Posted By  
  Re: 1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
# 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-- )

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

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*/


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

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

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


Is This Answer Correct ?    3 Yes 0 No
C++ Coder

Other OOPS Interview Questions
  Question Asked @ Answers
What is a friend function & its advantage? MIT 1
define oops with class and object Tech-Mahindra 5
I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?   3
what is multithreading in c++ , what is difference between multithreading and singlethreading.   4
why overriding?   3
difference between abstraction and encapsulation with progarammatic eg. hi,just recently i went for an interview .The interviewer asked what is the difference between abstraction and encapsulation with programmatic eg. I gave the answer as encapsulation mean hiding the relevant data which is not useful for the user, eg a electric fan .hiding the information how the electricity is converted into machanical energy. abtraction showing only the relevant data to the user eg electric fan. it look ,its color ,it design etc only relevant data. Then the interviewer asked me, give me some programmic eg .I Said Let assume a web form having control like textbox,button etc. The user can view textbox,button etc this is the eg of abstraction and when the user click on the button how he is redirected is not known by the user is the eg of the encapsulation. Am I Correct .was the answer given by me is perfect .now i am planing to go for an another interview should i give the same answer.IF not please suggest me a better answer.with some good eg Please help   1
Difference between vector and array   2
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.   2
What is a friend function & its advantage? TCS 2
What is the differances between a abstract calss and interface Aviva 5
What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 2) 17 3) 16.5 TCS 16
create a c++ program that will accepts 9 inputs using 3 by 3 array.   1
For more OOPS Interview Questions Click Here 

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