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..
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
super problem this is......
#include<stdio.h>
#include<conio.h>
void main()
{
int count ,m,n;
printf("enter the size :");
scanf("%d",&m);
printf("enter the seed :");
scanf("%d",&n);
count =n;
for(int i=1;i<=m;i++)
{
printf("\n");
for(j=1;j<=i;j++)
{
printf("%d",count);
count++;
if(count>=10)
count=1;
}
}
getch();
}
thank you
| Is This Answer Correct ? | 10 Yes | 3 No |
Answer / 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 |
Answer / prashant
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
printf("enter the size");
scanf("%d",&n1);
printf("enter the seed");
scanf("%d",&n2);
for(i=1;i<n1;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 9 No |
Answer / 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 |
What are the different pointer models in c?
What is "Duff's Device"?
Why isnt there a numbered, multi-level break statement to break out
How do you generate random numbers in C?
What compilation do?
7 Answers Geometric Software, Infosys,
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What does the c in ctime mean?
What is Dynamic Initialization.
What are identifiers in c?
Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?
In which header file is the null macro defined?
Which is the memory area not included in C program? give the reason