C programming made easy.
#include<stdio.h> int main() { int i,j,n,no=1; printf("Enter no of rows "); scanf("%d",&n); for(i=1;i<=n;i++) { printf("\n"); for(j=1;j<=i;j++) { printf("%d ",no); no++; } } return 0; }
No comments:
Post a Comment