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 |
Are the variables argc and argv are local to main?
What is the difference between calloc() and realloc()?
how to multiply two number taking input as a string (considering sum and carry )
how to print "hai" in c?
can any one provide me the notes of data structure for ignou cs-62 paper
Should a function contain a return statement if it does not return a value?
List out few of the applications that make use of Multilinked Structures?
what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
Do string constants represent numerical values?
What is the restrict keyword in C?