write a C++ programming using for loop:
*
* *
* * *
* * * *
Answers were Sorted based on User's Feedback
Answer / debotri das
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int line,n,i;
cout<<"Enter no of line\n";
cin>>n;
for(line=1;line<=n;line++)
{
for(i=1;i<=line;i++)
{
cout<<" * ";
}
cout<<" \n ";
}
getch();
}
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / devi
#include<iostream.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<"\n";
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / amit
void main()
{
int i,j;
for(i=1;i<=4;i++)
{
for(j=1;j<=1;j++)
cout<<"*"
cout<<endl;
}
getch();
}
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / ashutosh garg
for(i=1 i<=5; i++){
for(j=1;j<=i;j++){
cout("*");
}//inner-for
cout("\n");
}//outer-for
Is This Answer Correct ? | 5 Yes | 7 No |
Define basic type of variable used for a different condition in C++?
Differentiate between structure and class in c++.
template<class T, class X> class Obj { T my_t; X my_x; public: Obj(T t, X x) : my_t(t), my_x(x) { } }; Referring to the sample code above, which one of the following is a valid conversion operator for the type T? a) T operator T () { return my_t; } b) T operator(T) const { return my_t; } c) operator(T) { return my_t; } d) T operator T (const Obj &obj) { return obj.my_t; } e) operator T () const { return my_t; }
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
What is an explicit constructor?
1.what is the difference between software & package &application.
how many trys can we write in one class
What are the two types of comments?
Define a pdb file.
What are the characteristics of friend functions?
Can a class be static in c++?
Is java the same as c++?