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 |
What is the difference between new() and malloc()?
What is the difference between passing by reference and passing a reference?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
what is importance of data sturture in a programming language?
22 Answers L&T, TCS, Wipro,
Why do we need runtime polymorphism in c++?
How is memory managed in C++?
Will c++ be replaced?
why is c++ called oops? Explain
What are virtual functions in c++?
By using c++ with an example describe linked list?
When a function is made inline. Write the situation where inline functions may not work.
Write bites in Turbo c++ Header ("Include") Files.