Triangle Star Pattern Task

Your task is to print a triangle pattern using stars (*) for a given integer N, which represents the number of rows.

Input:

Integer N (Total number of rows)

Output:

The triangle pattern printed over N lines

Example:

Input:
N = 4
Output:
*
**
***
****

Constraints:

  • 0 <= N <= 50
Note:

There are no spaces between the stars (*) on each line.

Anonymous
1mo
1
Anonymous
3mo
Hai
Anonymous
3mo
8
Thiruselvam
7mo
ex -
I m fresher
Given a number n the task is to print the star pattern in singing loop. Approach the idea is to . break a column into three parts and solve each . parts independently. Of the other. The triangle numbe...read more
Arti. Prajapati
1y

Given a number n the task is to print the star pattern in singing loop. Approach the idea is to . break a column into three parts and solve each . parts independently. Of the other. The triangle numbe...read more

Anonymous
2y
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner s=new Scanner(System.in); int n; n=s.nextInt(); int i=1; while(i<=n) { int j=; while(j<=i) { System.o...read more
MILAN SENAPATI
2y
#include<iostream> using namespace std; int main(){ int N; cout<<"enter N"<<endl; cin>>N; int i; while (i<=N) { int j=1; while (j<=i) { cout<<"*"; j++; } cout<<endl; i++; } return 0; ...read more
Add answer anonymously...
Wipro Project Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter