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

Which bit wise operator is suitable for turning off a particular bit in a number?

0 Answers  


Define pointers?

0 Answers  


What is the difference between set and map in c++?

0 Answers  


Can user-defined object be declared as static data member of another class?

0 Answers  


how to swap two strings without using any third variable ?

11 Answers  






Explain abstraction.

0 Answers  


What is enum c++?

0 Answers  


Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D

1 Answers  


Which format specifier is used for printing a pointer value?

0 Answers  


given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 c)ui1 | ui2 d)ui1 || ui2 i also need the justification for the answers thank you

2 Answers  


What are the implicit member functions of class?

0 Answers  


Does std endl flush?

0 Answers  


Categories