//Example 12.8 clc; clear; V0= 10*((1/2)+(1/4)+(1/32)+(1/128)); // calculating voltage when 1,2,5,7 re high printf("Output voltage = %f V",V0)//displayin result