Monday 31 October 2016

Mimicry


Decimal to Octal Conversion in Java


package conversiontooct;

class A
{
    int i,x,y,z,c,d;
    int[] a=new int[100];
    int[] b=new int[100];
    
    A(int x)
            {
            
                this.x=x;
            }
    
    void displayNum()
    {
        i=0;
        
        while(x !=0)
        {
            y=x%8;
            z=x/8;
            a[i]=y;
            x=z;
            i++;
                        
        
        }
        
        for(c=i-1,d=0;c>=0;c--,d++)
        {
            b[d]=a[c];
            System.out.print(b[d]);
        }
         
         
         System.out.println();
    }

}



public class ConversiontoOct {
 
    
    public static void main(String[] args) {
        
        A a=new A(155);
        a.displayNum();

        A b=new A(156);
        b.displayNum();
       
    }
    
}

Decimal to Hexadecimal Conversion in Java




package conversiontohex;

class A
{
    int i,x,y,z,c,d;
    int[] a=new int[100];
    int[] b=new int[100];
   
    A(int x)
            {
           
                this.x=x;
            }
   
    void displayNum()
    {

        i=0;
       
        while(x !=0)
        {
            y=x%16;
            z=x/16;
            a[i]=y;
            x=z;
            i++;
                       
       
        }
       
        for(c=i-1,d=0;c>=0;c--,d++)
        {
            b[d]=a[c];
        }
         for (i=0;i<d;i++)
         {
             if(b[i]==10)
                 System.out.print("A");
             else if(b[i]==11)
                  System.out.print("B");
             else if(b[i]==12)
                System.out.print("C");
             else if(b[i]==13)
                 System.out.print("D");
             else if(b[i]==14)
                 System.out.print("E");
             else if(b[i]==15)
                 System.out.print("F");
             else
                System.out.print(b[i]);
         }
       
         System.out.println();
    }

}



public class ConversiontoHex {
   
 
    public static void main(String[] args) {
       
        A a=new A(155);
        a.displayNum();

        A b=new A(156);
        b.displayNum();
   
    }
   
}


Saturday 29 October 2016

Travelling Through the Canopy of Ignorance

As we move through the canopy of ignorance ...we may feel complacent albeit unaware where it might lead us to....We may get lost in the canopy and feel bliss and composure...for someone like me this canopy becomes indispensable to get shielded from the glaring, scorching sun rays ...the rays which are the disguise of relentless negativity and insane competition ..this canopy shields me from the vicious atrocities..yet pushes me deep in a filthy quicksand...which makes me vile to the outer world...for I have for long been decomposing in the quick sand with dearth of fresh air, breeze, and healthy sunlight...I wish to come out of this canopy in a world familiar to me..that I want to be a part of..the land of utter bliss, knowledge, complacency, benevolence, and kindness...I hope to come out of this dark canopy and see a pleasant dawn soon...