Saturday, December 31, 2011

Print following pattern in Continuous number 'C'.


  1
  23
  456
  78910

Example



#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,k=1;
clrscr();
printf("Enter the value of n:");
scanf("%d",&n);

for(i=1;i<=n;i++)

{

for(j=1;j<=i;j++)

{

     printf("%d",k);

     k++;
}
printf("\n");
}
getch();
}
/*=====================================================================
OUTPUT
Enter the value of n:4


1
23
456
78910
*/

No comments:

Post a Comment