Programming Midterm

6 what is scanf for scanf accepts a string and a list

Info icon This preview shows pages 2–3. Sign up to view the full content.

View Full Document Right Arrow Icon
6. What is scanf for? scanf accepts a string and a list of pointers as variables. Pointers allow it to place values in the corresponding values (&num1 is a pointer to num1). % starts a datatype specifier, with %d indicating an integer. scanf looks at "%d" and knows that there is one variable that should have an integer value placed in it. You can use other specifiers for other data types, and will see those as you continue to learn. The specifier string gives scanf a huge amount of flexibility, even though it's a little cumbersome, at first. 7. What is Boolean Algebra? Study of mathematical operations performed on certain variables (called binary variables) that can have only two values: true (represented by 1) or false (represented by 0). It provides a set of rules (called Boolean logic ) that are indispensable in digital computer-circuit and switching- circuit design . 8. Name all of the logical operators and what they are used for? Operator Symbol Form Operation Logical NOT ! !x true if x is false, or false if x is true Logical AND && x && y true if both x and y are true, false otherwise Logical OR || x || y true if either x or y are true, false otherwise 9. What is the isdigit function? checks whether a character is numeric character(0-9) or not.
Image of page 2

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern