parkside's triangle..

create a program like this..

enter the size: 6
enter the seed: 1

output:

1
23
456
7891
23456
789123

sample2:

enter the size: 5
enter the seed: 3

output:

3
45
678
9123
45678

parkside should not exceed 10 while its seed should only be
not more than 9..

Answer Posted / dally

/////********For first question**********/
#include<stdio.h>
int main()
{
int n,i,j,k=1;

printf("Enter values for n\n") ;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<=i;j++)
printf("%d\n",k);
printf("\n");
k++;
}
}
IT WILL PRINT
1
2 3
4 5 6
7 8 9 10

********************************
For second question
********************************

#include<stdio.h>
int main()
{
int i,j,n,k=3;

printf("Enter value for n\n") ;
scanf("%d",&n);

for(i=0;i<=n;i++)
{
for(j=0;j<=i;j++){
printf("%d",k);
k++;
}
printf("\n");
if(k == 10)
k=1;
}

}
IT WILL PRINT
3
45
678
9123
45678

Is This Answer Correct ?    1 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the benefit of using const for declaring constants?

695


Is array name a pointer?

696


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

832


Where register variables are stored in c?

649


what are non standard function in c

1534






How do you define structure?

671


Why do we use stdio h and conio h?

744


What is a stream water?

771


What are the various types of control structures in programming?

703


How are strings stored in c?

688


Explain how do you print only part of a string?

751


What are the benefits of c language?

750


What are the advantages and disadvantages of a heap?

788


What does the format %10.2 mean when included in a printf statement?

1206


Why is sizeof () an operator and not a function?

675