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
What are the differences between new and malloc in C?
Explain how can I convert a number to a string?
Which header file is used for clrscr?
What is the best organizational structure?
What is the use of c language in real life?
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
Why is main function so important?
Is there a built-in function in C that can be used for sorting data?
What is sizeof array?
Is it better to use a macro or a function?
Can you please explain the scope of static variables?
What are the Advantages of using macro
What are linked lists in c?
What are the disadvantages of external storage class?