Question

In: Computer Science

c program Evaluate the expression 1 && (30%10 >=0) && (30 %10<=3) Is either set of...

c program

  1. Evaluate the expression
    1. 1 && (30%10 >=0) && (30 %10<=3)
    2. Is either set of parentheses required?
    3. Write the complement of the expression two ways. First, add one operator and one set of parentheses. For the second version, use DeMorgan’s theorem.

Solutions

Expert Solution

       i ) 1 && (30%10 >=0) && (30 %10<=0) will return 1.

       30%10 = 0 return Trrue

        30 %10 =3 which is less than 3 , return true

     ii) no paranthases required,it will return 1

     proof for i And ii

     iii)

              method 1

              -> (1 + (30%10 >=0))' = 0

             -> 0 && ((30 %10<=3) ) ' = 0 + 0 = 0

        then

           compliment of 1 && (30%10 >=0) && (30 %10<=0) = 0

       demorgans law

     (A+B+C )' =A' * B' * C'

    (1 && (30%10 >=0) && (30 %10<=0)) ' = 1 ' * (30%10 >=0)' * (30 %10<=0)'

                                                                 =0 * (30%10 >=0)' * (30 %10<=0)'

                                                                 = 0


Related Solutions

(1) (2) (3) DI C DI C DI C $0 $4 $0 $65 $0 $2 10...
(1) (2) (3) DI C DI C DI C $0 $4 $0 $65 $0 $2 10 11 80 125 20 20 20 18 160 185 40 38 30 25 240 245 60 56 40 32 320 305 80 74 50 39 400 365 100 92 Refer to the given consumption schedules. DI signifies disposable income and C represents consumption expenditures. All figures are in billions of dollars. At an income level of $40 billion, the average propensity to consume is...
C++ PROGRAMING Implement a program to evaluate simple mathematical expressions. Assume that the original expression is...
C++ PROGRAMING Implement a program to evaluate simple mathematical expressions. Assume that the original expression is provided to the program as a text string. Allowed expression tokens: brackets “(” and “)”, integers like “4”, “15”, addition “+”, subtraction “-”, multiplication “*”, division “/”. Output can be float. Trim spaces from an expression. Brackets should contain at least one operation. Make sure that an expression is validated before it is calculated; reject the invalid expressions with appropriate message. The program must...
Write a C program to run on ocelot which will either set or clear a single...
Write a C program to run on ocelot which will either set or clear a single bit in a number entered by the user using the binary representation of the number. The user should input the original integer value between 1 and 1000 inclusive using a scanf. Use an unsigned integer type. Output is to the screen. You must use only bitwise operators for this program. You can shift bits and or use the logical bitwise operators. For this assignment...
Write a C program to run on ocelot which will either set or clear a single...
Write a C program to run on ocelot which will either set or clear a single bit in a number entered by the user using the binary representation of the number. The user should input the original integer value between 1 and 1000 inclusive using a scanf. Use an unsigned integer type. Output is to the screen. You must use only bitwise operators for this program. You can shift bits and or use the logical bitwise operators. For this assignment...
3. In R4 , does the set {(1, 1, 1, 0,(1, 0, 0, 0),(0, 1, 0,...
3. In R4 , does the set {(1, 1, 1, 0,(1, 0, 0, 0),(0, 1, 0, 0),(0, 0, 1, 1)}, span R4? In other words, can you write down any vector (a, b, c, d) ∈ R4 as a linear combination of vectors in the given set ? Is the above set of vectors linearly independent ? 4. In the vector space P2 of polynomials of degree ≤ 2, find explicitly a polynomial p(x) which is not in the span...
1.Evaluate the integral C where C is x=t^3 and y=t, 0 ≤ t ≤ 1 2.Find...
1.Evaluate the integral C where C is x=t^3 and y=t, 0 ≤ t ≤ 1 2.Find the area of the surface with vectorial equation r(u,v)=<u,u sinv, cu >, 0 ≤ u ≤ h, 0≤ v ≤ 2pi
Given that the set X = 1, 2, 3, 5, 6, 10, 15, 30) and Poset...
Given that the set X = 1, 2, 3, 5, 6, 10, 15, 30) and Poset (X, ≼). The relation ≼ is defined as follows: (x, y X) x ≼ y ↔ x factor of y Question i). Draw a Hasse diagram of the Poset. ii). Specify maximum, Maximum, Minimum, Minimum (if any) elements iii). Is the relation "≼" a Lattice? Explain !
Create a C program that will test the following : Theory (0-70): 65 Laboratory (0-30): 25...
Create a C program that will test the following : Theory (0-70): 65 Laboratory (0-30): 25 Total Marks: 90
Regular expression translation [ac7]b[bc] Translation: Match any 1 character in a set that is either a,...
Regular expression translation [ac7]b[bc] Translation: Match any 1 character in a set that is either a, c, or 7, then a b, then any 1 character that is in a set that is either b or c. Match example: abc ^…$ \<the\> ^[A-Z]..$ ^[A-Z][ a-z]*3[0-5] [a-z]*\.$ ^ *[A-Z][a-z][a-z]$ ^[A-Za-z]*[^,][A-Za-z]*$ [[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3} .*\([0-9][.][0-9]\) [0-9]{3}-[0-9]{4}
Your assignment for this program is to evaluate a numeric expression in postfix notation using a...
Your assignment for this program is to evaluate a numeric expression in postfix notation using a dynamic (pointer based) stack. As stated in the handout, in order to evaluate a numeric expression, a compiler converts an infix numeric expression to postfix notation and then it uses an algorithm and a stack to evaluate the expression. Your program should implement the pseudocode algorithm described in the attached handout. Your program will read and evaluate expressions stored in an input file (infile.txt)....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT