online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
''' Program : To find subsets of the given set name : Pamu Sohith Id : N190830 ''' #function to get binary of number def binaryof(a, arr): i = 0 while(a): arr[i]= a%2 a //= 2 i += 1 #function to rearrange the subsets in sorted order based on lenght def rearrange(arr): for i in range(len(arr)): for j in range(len(arr)-1-i): if len(arr[j]) > len(arr[j+1]): arr[j],arr[j+1] = arr[j+1],arr[j] print("enter the elements : ",end="") arr = [int(x) for x in input("").split()] binary = [0 for i in range(len(arr))] subsets = [] for i in range(2**len(arr)): set = [] binaryof(i,binary) for j in range(len(binary)): if(binary[j] == 1): set.append(arr[j]) subsets.append(set) rearrange(subsets) print("set of all subsets of the given set",arr,":") for i in subsets: print("\t",i)

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue