diff options
Diffstat (limited to '3836/CH9/EX9.8/Ex9_8.sce')
-rw-r--r-- | 3836/CH9/EX9.8/Ex9_8.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/3836/CH9/EX9.8/Ex9_8.sce b/3836/CH9/EX9.8/Ex9_8.sce new file mode 100644 index 000000000..4ede5dd28 --- /dev/null +++ b/3836/CH9/EX9.8/Ex9_8.sce @@ -0,0 +1,20 @@ +clear +//Initialization +ni1=11010 //binary number + +//Calculation +ni=ni1 +deci = 0 +i = 0 +while (ni > 0) + rem = ni-int(ni/10.)*10 + ni = int(ni/10.) + deci = deci + rem*2**i + i = i + 1 + end + +w=deci //calling the function + +//Declaration +printf("\n Decimal Equivalent = %f",w) + |