TCS Coding Problem 9

16 comments on “TCS Coding Problem 9”


  • sai

    void convertdectooct()
    {
    int n=350;
    String s=””;
    if(n8){
    if(n/8>8)
    {
    s=s.concat(Integer.toString(n%8));
    }
    else
    {
    s=s.concat(Integer.toString(n%8)).concat(Integer.toString(n/8));
    }
    n=n/8;
    }

    for (int i = s.length()-1; i >=0 ; i–) {

    System.out.print(s.charAt(i));
    }

    }


  • Vkjha

    a=int(input())
    d=[]
    b=a//8
    e=a%8
    d.append(b)
    d.append(e)
    print(str(d[0])+str(d[1]))