Quiz – Week 6

Exercise flickr photo by sanchom shared under a Creative Commons (BY) license

Resources on the Web

Go check out the C/C++ PROGRAMMING EXERCISES page and do the first five questions.

You should continue to look for more options of exercises to practice your programming. Some of these resources also show solutions but try to do the exercise yourself before looking at the solution. When you do find a solution, compare your solution to those of “the answer” as well as those of your classmates.

Notes

C++ keeps changing and runs different on different machines. For the first question you may want to use printf instead of cout to format the printing, check out the printf reference here.

Note that you will also need to include <stdio.h>

printf will also complain that you are not passing an int to the %d so perhaps you want to cast the sizeof value to an int like this:

int(sizeof(c)*8)

What to Do

Publish your answers on your blog post and perhaps in your repository on GitHub for the course.

Feature Image Credit

<a title="Exercise" href="https://flickr.com/photos/sanchom/2963072255">Exercise</a> flickr photo by <a href="https://flickr.com/people/sanchom">sanchom</a> shared under a <a href="https://creativecommons.org/licenses/by/2.0/">Creative Commons (BY) license</a> </small>
Exercise flickr photo by sanchom shared under a Creative Commons (BY) license

CC BY-SA 4.0 Quiz – Week 6 by admin is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

One thought on “Quiz – Week 6

Comments are closed.