write a program to print
*
* *
* * *
Answers were Sorted based on User's Feedback
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 |
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 |
why freind function takes more parameter than normal member function in c++?
What is class in oop with example?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
Can you explain polymorphism?
what are the disadvantages of C++?
25 Answers ATS, Infosys, UNI, Wipro,
for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)
what is virtual destructor
diff between Abstract class Interfaces?
write knight tour problem which is present in datastructure
what are the realtime excercises in C++?
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?
Finding of the 4 larger (bigger) numbers from the list like{1245,4587,2145,1163,29987,65783.....}