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 / vignesh1988i

a smalll change in this program...... sorry for the inconvience

#include<stdio.h>
#include<conio.h>
void main()
{
int m,n;
printf("enter the size :");
scanf("%d",&m);
printf("enter the seed :");
scanf("%d",&n);
if(n>=10)
n=1;
for(int i=1;i<=m;i++)
{
printf("\n");
for(j=1;j<=i;j++)
{
printf("%d",n);
n++;
if(n>=10)
n=1;
}
}
getch();
}

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a union?

694


Write the test cases for checking a variable having value in range -10.0 to +10.0?

1936


which is an algorithm for sorting in a growing Lexicographic order

1476


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2966


I need previous papers of CSC.......plz help out by posting them.......

1923






What is a structure and why it is used?

719


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

863


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

909


Explain how are portions of a program disabled in demo versions?

749


provide an example of the Group by clause, when would you use this clause

1826


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

711


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

765


Are there constructors in c?

696


How many levels of indirection in pointers can you have in a single declaration?

698


Write a code to generate a series where the next element is the sum of last k terms.

840