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

Explain what are accessor methods?

0 Answers  


What is c++ flowchart?

0 Answers  


What is a virtual destructor? Explain the use of it?

0 Answers  


What is c++ redistributable?

0 Answers  


Where is atoi defined?

0 Answers  






List out some of the object-oriented methodologies?

1 Answers  


Implement a 2 dimensional array by one dimentional array

1 Answers   CTS,


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

0 Answers   Telecom,


Why do we need constructors in c++?

0 Answers  


Describe the advantages of operator overloading?

0 Answers  


What is lambda expression c++?

0 Answers  


What are the four main data types?

0 Answers  


Categories