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
What standard functions are available to manipulate strings?
What is the use of #include in c?
the question is that what you have been doing all these periods (one year gap)
Can a pointer be null?
What is memory leak in c?
Under what circumstances does a name clash occur?
plz let me know how to become a telecom protocol tester. thank you.
What are pointers? What are stacks and queues?
Explain what are the __date__ and __time__ preprocessor commands?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
find the sum of two matrices and WAP for it.
What does. int *x[](); means ?
Should I learn c before c++?
What is the difference between malloc() and calloc() function in c language?
Write a program to check armstrong number in c?