Translate

Saturday, 29 May 2021

Coming soon .Net CORE

We are soon starting posts on .NET CORE. 


You will learn what is .NET Core, why should we use it, pros and cons of .NET Core and various assignments.


We will also have exciting hands on assignments and QA sections. 


You can follow this blog to receive new updates.

Wednesday, 31 August 2016

Write a java code to print following pattern

I
CC
SSS
EEEE

Solution:

class printABCD
{
     public static void main(String abc[])
     {
    char arr[]={'I','C','S','E'};   // Store alphabets in an array
        for(int i=0;i<4;i++)
        {                                
            for(int j=0;j<=i;j++)
              {
                System.out.print(arr[i]);              
              }
          System.out.println();
         }
     }
}

Friday, 5 February 2016

Write a java code to print following pattern

(a)
(a+b)
(a+b+c)
(a+b+c+d)


Solution:

//PrintABCD.java
class PrintABCD
{
public static void main(String abc[])
{
for(int i=1;i<10;i++) // increase count 10 to 27 to print till "z"
        {          
            String strChars="";  
            int alphabet=97;                          //ASCII value of A = 65 and a=97
            for(int j=1;j<=i;j++)
              {
                strChars=strChars+(char)alphabet + " + ";
                alphabet++;
              } 
          System.out.println("(" + strChars.substring(0,strChars.length()-3) + ")");
         }
     }
}

Friday, 23 October 2015

Write a java code to print following pattern

AAAA
   AAA
      AA
         A
         A
         AB
         ABC
         ABCD

Solution:
//PrintABCD.java
class PrintABCD
{
     public static void main(String abc[])
     {
        printAAAA();
        printABCD();
     }
    
    static void printABCD()
    {
        for(int i=1;i<5;i++)
        {          
            for(int k=3;k>0;k--)
            {
                    System.out.print(" ");
            }      
           
            int alphabet=65;                          //ASCII value of A
            for(int j=1;j<=i;j++)
              {
                System.out.print((char)alphabet);
                alphabet++;
              }
          System.out.println();
         }
}

    static void printAAAA()
    {
        int alphabet=65;                          //ASCII value of A
        for(int i=4;i>0;i--)
        {      
            for(int k=4;k>i;k--)
            {
                    System.out.print(" ");
            }   
                for(int j=1;j<=i;j++)
                {
                    System.out.print((char)alphabet);
                }
                System.out.println();
         }
    }
}

Saturday, 26 September 2015

Write a Java code to print following pattern

A
BC
DEF
GHIJ

Solution:
 
//PrintABCD.java
class PrintABCD
{
     public static void main(String abc[])
     {
        int alphabet=65;                          //ASCII value of A
        for(int i=1;i<5;i++)
        {           
            for(int j=1;j<=i;j++)
              {
                System.out.print((char)alphabet);
                alphabet++;
              }
          System.out.println();
         }
     }
}

Sunday, 31 May 2015

Write a java code to print following pattern

 
J
JA
JAV
JAVA
JAVAJ
JAVAJ2
JAVAJ2E
JAVAJ2EE

Solution:

class PrintJava
{
public static void main(String[] args)
{
char[] arrChar={'J','A','V','A','J','2','E','E'};
for(int i=0;i<=8;i++)
{
for(int j=0;j<i;j++)
{
System.out.print(arrChar[j]);
}
System.out.println();
}
}
}

Friday, 8 May 2015

Write a java code to print following pattern

1
23
456

Solution:

class printPattern
{
     public static void main(String abc[])
     {
        int counter=1;    
        for(int i=1;i<4;i++)
        {                    
            for(int j=1;j<=i;j++)
              {
                System.out.print(counter);
                counter++;
              }
              System.out.println();
         }
     }
}