Problem 10

6 comments on “Problem 10”


  • Febin

    c=0
    s=0
    n=int(input(“Enter number:”))
    while n > 0:
    r=int(n%10)
    p=pow(8,c)
    s=s+(r*p)
    n=int(n/10)
    c=c+1
    print(s)


  • Bathula

    #python
    binary = input(“Enter any number in Binary Format: “);
    if binary == ‘x’:
    exit();
    else:
    temp = int(binary, 2);
    p=oct(temp)
    a=p.replace(“0o”,””)
    print(a)


  • Bathula

    #python
    binary = input(“Enter any number in Binary Format: “);
    if binary == ‘x’:
    exit();
    else:
    temp = int(binary, 2);
    print(temp)
    p=oct(temp)
    a=p.replace(“0o”,””)
    print(a)