print the pattern 1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
if n=5
Answer Posted / vamsi talapatra
#include<iostream>
using namespace std;
int main(){
int n = 1;
int l = 1;
while(n<=5){
for(int i = 1; i<=l; i++){
cout<<n*i<<" ";
}
cout<<endl;
l++;
n++;
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Difference between MAC vs. IP Addressing
Is there any demerits of using pointer?
What is the use of header files?
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.
Explain pointer. What are function pointers in C?
What is the method to save data in stack data structure type?
What is a static function in c?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
How macro execution is faster than function ?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.
What is the use of extern in c?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
What does calloc stand for?
Define and explain about ! Operator?