print this pattern(write a program
1
12
123
1234
12345
Answers
Answered by
2
Answer:
code in c++
Explanation:
#include<bits/stdc++.h>
using namespace std;
int main ()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
cout<<j;
}
cout<<endl;
}
}
Answered by
1
Easiest program:
package com.company;
public class Main {
public static void main(String[] args) {
int s = 0;
for (int i = 1; i <= 5 ; i++) {
s = s*10+i;
System.out.println(s);
}
}
}
Output:
1
12
123
1234
12345
Similar questions
English,
2 months ago
Computer Science,
5 months ago
Math,
5 months ago
Math,
11 months ago
Science,
11 months ago