+ 1
How could I could a number pattern
//4321 //432 //43 //4 Like this one Int main() { Int i,j; For (int i = 1; i<= 4; i++) { For (int j = 1; j<= 4; j--) Using cpp
3 Answers
+ 3
Benito Estimo
Using CPP--
for(int i = 0; i < 4; i++) {
for (int j = 4; j > i; j--) {
cout << j;
}
cout << endl;
}
https://code.sololearn.com/ctBzd7fm30jO/?ref=app
+ 2
#include<stdio.h>
int main()
{
int i,j,k;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
if(j<=i)
printf("%d",j);
else
printf(" ");
}
printf("\n");
}
return 0;
}
+ 1
Try thisâ
#include<iostream>
using namespace std;
int main()
{
int i=0,j=4;
Outside:
if(i++<=4)
{
j=5;
Inside:
if(j-->i)
{cout<<j;
goto Inside;}
cout<<endl;
goto Outside;}
return 0;
}