Saturday 7 October 2023

BigData-Slip17 Write an R Program to calculate Decimal into binary of a given number.

 Slip17

Write an R Program to calculate Decimal into binary of a given number.

>  binary_conversion<-function(n){

+    if(n>1){

+     

+      binary_conversion(as.integer(n/2))

+    }

+    cat(n%%2)

+  }

>  binary_conversion(11)

1011> //Output