Q.11 Generate the following pattern using code in any
language(c/c++/java) for n no. of rows
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Answers were Sorted based on User's Feedback
Answer / balaji ganesh
main()
{
int a[20][20],i,j,n;
clrscr();
a[0][0]=1;
scanf("%d",&n,printf("enter how many rows you want:"));
for(i=0;i<n;i++)
{a[i][0]=1;a[i][i]=1;
for(j=1;j<i;j++)
a[i][j]=a[i-1][j-1]+a[i-1][j];
}
for(i=0;i<n;i++)
{printf("\n\n");
for(j=0;j<=i;j++)
printf("%d ",a[i][j]);
}
getch();
}
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / sandeep roy
public static void main(String[] args) {
int j=11;
int s=11;
for(int i=1;i<=5;i++) {
if(i==1)
System.out.println(i);
else
{
System.out.println(s);
s=s*j;
}
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
write a program to generate 1st n fibonacci prime number
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]
Explain which function in c can be used to append a string to another string?
What is structure in c definition?
what is the difference between strcpy() and memcpy() function?
What does the characters “r” and “w” mean when writing programs that will make use of files?
const char * char * const What is the differnce between the above tow?.
write a c programs to do multiplication of two numbers with out using arithmatic operator ??????????
what is the differnce between AF_INET and PF_INET?
5 Answers Systems Plus, Wipro,
What is a pointer in c?
Explain what is wrong in this statement?
Write a program to produce the following output in c language? 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1