1 22 333 4444 Any text editor is usable for that.
1 22 333 4444 But if your question was about printing this sequence for nth term, then:
#include
#include
void main()
{
int n,i,j;
clrscr();
printf("Enter the last limit\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
}scanf(" ");
getch();
}
Hey look the above code will print out the series up-to the nth limit which is inputed from the user.
If u use only puts() then u have limitation, i.e. u can't print the series up-to nth term in a normal way and generally this program appears in series up-to nth term.
Thank u.
for (int i=1;i<6;i++) {
for (int k=0;k<i;k++)
print(i);
printnewline();
}
In PhP you would write something lime this;
<html>
<head>
<title>Exercise-2>
</head>
<body>
<?
{
for ($count =1; $count <10; $count++)
{
for ($newcount =0; $newcount<$count; $newcount++)
{
$answer = "$count<BR>";
{
echo "$answer";
}
}
}
}
?>
</body>
</html>
Implement this method: public static void makeTriangle(int limit) { int count = 0; for(int i = 1; i <= limit; i++) { count = i; while(count > 0) { System.out.print(i); count--; } System.out.println(); } }
#include <stdio.h> int main (void) { puts ("1 22 333 4444 55555"); return 0; }
#include <stdio.h> int main (void) { puts ("4 1 44 11 444 111 4444 1111 000000000 444444 3333 22 1"); return 0; }
using System;namespace RightAngleTraingle{class Program{static void Main(string[] args){for (int x = 1; x
The solution is two use a nested for loop: int startingNum = 1; int maxNum = 10; for(int currentNum = startingNum; currentNum <= maxNum; currentNum++) { for(int j = 0; j < currentNum; j++) { printf("%d", currentNum); } printf("\n"); }
int i = 4;while (i>0) { for (int n=0; n<i; ++n) { printf ("%d", i); } printf (" "); } printf ("\n");
Each digit is repeated the number of times equal to its value. 1 22 333 4444 55555 666666 7777777 88888888 999999999
This is one of possible solutions:
22 x 11 x 101 = 4444
Implement this method: public static void makeTriangle(int limit) { int count = 0; for(int i = 1; i <= limit; i++) { count = i; while(count > 0) { System.out.print(i); count--; } System.out.println(); } }
#include <stdio.h> int main (void) { puts ("1 22 333 4444 55555"); return 0; }
#include<iostream> int main (void) { std::cout << "1 22 333 444\n"; } To produce the text programmatically: #include<iostream> int main (void) { for (int num=1; num<=4; ++num) { // the number to be printed for (int rep=1; rep<=num; ++rep) { // the repetitions of that number std::cout << num; } std::cout << ' '; // space } std::cout << '\n'; // new line }
355
#include <stdio.h> int main (void) { puts ("4 1 44 11 444 111 4444 1111 000000000 444444 3333 22 1"); return 0; }
22 and 333 are composite numbers.
using System;namespace RightAngleTraingle{class Program{static void Main(string[] args){for (int x = 1; x
the product of 22 by 2 is 4444