write a C++ programming using for loop:
*
* *
* * *
* * * *

Answers were Sorted based on User's Feedback



write a C++ programming using for loop: * * * * * * * * * *..

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

write a C++ programming using for loop: * * * * * * * * * *..

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

write a C++ programming using for loop: * * * * * * * * * *..

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

write a C++ programming using for loop: * * * * * * * * * *..

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

Post New Answer

More C++ General Interview Questions

Define basic type of variable used for a different condition in C++?

0 Answers  


Differentiate between structure and class in c++.

0 Answers  


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; }

1 Answers   Quark,


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

0 Answers  


What is an explicit constructor?

1 Answers  






1.what is the difference between software & package &application.

1 Answers   Infosys,


how many trys can we write in one class

3 Answers   Cap Gemini,


What are the two types of comments?

0 Answers  


Define a pdb file.

0 Answers  


What are the characteristics of friend functions?

0 Answers  


Can a class be static in c++?

0 Answers  


Is java the same as c++?

0 Answers  


Categories