1234
123
12
1
how to generate the above pattern
Answers
Answered by
1
this code can generate:)
Attachments:
kvnmurty:
the program can be as simple as shown in my answer. i request you to see that.
Answered by
2
#include <stdio.h>
main {
int row, col;
for (row=4; row >= 1 ; row--) {
for (col=1 ; col <= row ; col++)
printf("%d",col);
printf("\n");
}
}
===========================
C Plus Plus
#include <iostream>
using namespace std;
int main()
{
int row, col;
for (row=4; row >=1 ; row--) {
for (col =1 ; col <= row ; col++ )
cout << col ;
cout << "\n" ;
}
}
main {
int row, col;
for (row=4; row >= 1 ; row--) {
for (col=1 ; col <= row ; col++)
printf("%d",col);
printf("\n");
}
}
===========================
C Plus Plus
#include <iostream>
using namespace std;
int main()
{
int row, col;
for (row=4; row >=1 ; row--) {
for (col =1 ; col <= row ; col++ )
cout << col ;
cout << "\n" ;
}
}
Similar questions