C Programming Tutorial 42 – Quiz Part 2

Just as a reminder, up next we will be covering logic, conditionals, loops, and how to make more complex programs. But before this, I think it is important to make sure we have the previous blogs down well. These next blogs and previous blog will quiz you on some parts of C. If you have a hard time answering these question, you might want to review your notes. Are you new here? Start at the beginning, Intro to C!

Questions:

1. What is casting?

2. When you cast a double to an integer, is the number rounded or truncated?

3. What is the last character that you have to put in a character array to make a string?

4. What are the two ways to make comments in C and what is the difference?

5. What are primitive data types vs complex data types?

6. What is format character used for integers?

7. What is the format character used to print floating point numbers?

8. What do you need to prefix the format characters with when you are using scanf?

9. When using scanf, what is special about the way you pass in the variable?

10. What is the ASCII code for capital A?

11. What is the difference between ‘A’, and “A”?

Answers:

1. Casting is changing the data type of an expression

2. Truncated

3. We only briefly talked about this one so if you’re not sure, that’s okay

4. /*  */ and //.  The first is a multiline comment

5. Primitive data types are the foundational data types, such as integers. You can combine primitive data types to make more complex data types

6. Either %d or %i

7. %f, %e, and %e

8. You have to use a special operator before your name.  &, the address-of operator

9. 65

10. They’re both constant values, but the first is a character while the second is a single character string

Ready to learn more? Read the next blog on the third part of our quiz!

Leave a Reply

Your email address will not be published. Required fields are marked *