write a program to print
*
* *
* * *

Answers were Sorted based on User's Feedback



write a program to print * * * * * * ..

Answer / nash

#include <iostream>
using namespace std;
int main()
{
int i, j, k, m = 10, n;
for (i=0; i<=10; i++){
// Insert one loop to cal culate space to
be kept at start point
for (j=1; j<=m; j++){
cout << " ";
}
for (k=0; k<=i; k++){
cout << " *"; // put here "space
*" so all aligns properly like star

}
cout << '\n';
m--;
}
cin >> n;
return 0;
}

Is This Answer Correct ?    7 Yes 0 No

write a program to print * * * * * * ..

Answer / shani jaiswal

#include <iostream.h>
int main()
{
int a,b,c,d=5,e=1,f=3;
for(c=1;c<=d;c++)
{
for(a=0;a<f;a++)
cout<<" ";
for(b=0;b<e;b++)
cout<<"* ";
cout<<'\n';
d--;
e++;
f--;
}
return 0;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

which is best institute to learn c,c++ in ameerpet hyderabad

1 Answers  


i had specified the access specifier for abstarct class member like (pure virtual function) as private.But it can be accessed by the derived class.How the private member of one class is accessed by other class.if any body face this problem and found the solution plz reply to me.

1 Answers   Syntel,


What is the difference between Home and $Home?

2 Answers   TCS,


Child cObj = new Parent() Wahts the output ?

8 Answers   Patni, TCS,


what is the difference between class and structure in C++?

9 Answers   Aspire, IBS, TCS,






//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }

1 Answers  


sir i want to know which posting to apply since i am BE CSE.. also want to know what are the rounds there for my interview...Expecting for ur valuable answer....

2 Answers  


2. Give the different notations for the class.\

0 Answers  


What is the benefit of oop?

0 Answers  


me get an assignent n its question is this 1.creat a set as in math i.ea={1,2} 2.insert element in it3. delete element don,t repeat any element 4.union 5. intersection of two sets plz help me i always pray for u n send me at ayeshawzd@hotmail.com f u have c++ how to program 5th addition then it is the 10.9 question in 10th chapter exercise

1 Answers  


How to calculate the age from the date of birth by using the program?

2 Answers   Accenture,


What are the important components of cohesion?

0 Answers  


Categories