print the pattern 1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
if n=5

Answer Posted / murthyknm

public class Pattern
{
public static void main(String args[])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print(i*j+" ");
}
System.out.println();
}
}
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c called "mother" language?

855


Does c have circular shift operators?

726


Explain argument and its types.

598


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

774


Why we use int main and void main?

533






Do you know null pointer?

605


State the difference between realloc and free.

627


What is console in c language?

601


What is structure and union in c?

594


What are the valid places to have keyword “break”?

647


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1514


What are linked lists in c?

647


What is the use of c language in real life?

527


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.

2264


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

653