No products in the cart.

Write a programme to print n …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a programme to print n no. Of stars in a line
  • 2 answers

Rahul Sharma 7 years, 2 months ago

#include<iostream.h>
#include<conio.h>

void main()
{
int i,j,k;
clrscr();
for(i=1; i<=5; i++)
{
for(j=4; j>=i; j--)
{
cout<<" ";
}
for(k=1; k<=(2*i-1); k++)
{
cout<<"*";
}
cout<<"\n";
}
getch();
}

Rahul Sharma 7 years, 2 months ago

<pre class="brush: cpp;toolbar: false; gutter: true;"> /* * C program to print triangle pyramid pattern using * */ #include<stdio.h> #include<conio.h> int main() { int i,j,rows; printf("Enter the number of rows\n"); scanf("%d", &rows); for(i = 1; i <= rows; i++) { /* Prints one row of triangle */ for(j = 1; j <= i; ++j) { printf("* "); } printf("\n"); } getch(); return 0; }</pre>
http://mycbseguide.com/examin8/

Related Questions

Write a program for swapping two numbers?
  • 0 answers
What is alu
  • 1 answers
Write a program for swapping two numbers
  • 1 answers
Define packages
  • 0 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App