Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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 ?    5 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

if u write a class do u write Assignment operator and copy constructor

1 Answers   Siemens,


What is difference between abstraction and encapsulation?

0 Answers  


what are the characteristics of oops?

7 Answers   NIIT,


what is the diffrence between c# and c++

5 Answers  


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

2 Answers  






why destructor is not over loaded?

5 Answers  


What type of Job you are providing?

0 Answers  


Why interface is used?

0 Answers  


Write 7 differences between "Public" function and "Private" function?

2 Answers   IBM, Wipro,


What is encapsulation example?

0 Answers  


OOP'S advantages of inheritance include:

1 Answers   Infosys,


what is the difference b/w abstract and interface?

2 Answers   Merrill Lynch, Schneider, Scio Healthcare,






Categories