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
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is the use of bit field?
What is struct node in c?
What is the difference between pure virtual function and virtual function?
How can you increase the size of a statically allocated array?
how should functions be apportioned among source files?
What are enums in c?
What is difference between Structure and Unions?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Explain what are compound statements?
Write a program to print all permutations of a given string.
Explain a file operation in C with an example.
What is an expression?