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
What is 2 d array in c?
How can I do serial ("comm") port I/O?
What is the argument of a function in c?
C language questions for civil engineering
Explain how do you determine whether to use a stream function or a low-level function?
What are the two forms of #include directive?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What is the difference between text and binary i/o?
Explain union.
can anyone suggest some site name..where i can get some good data structure puzzles???
Can the “if” function be used in comparing strings?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
How can you increase the allowable number of simultaneously open files?
How do you determine whether to use a stream function or a low-level function?
How can you access memory located at a certain address?