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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two types of functions in c?

550


In which header file is the null macro defined?

835


Why does this code crash?

602


What is variable and explain rules to declare variable in c?

541


writ a program to compare using strcmp VIVA and viva with its output.

1507






What are the different types of objects used in c?

556


What is an lvalue?

618


Can the curly brackets { } be used to enclose a single line of code?

701


Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.

2638


Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc

5040


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3488


What language is lisp written in?

599


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

609


What are derived data types in c?

597


Why do we need functions in c?

540