Review Questions
Find the value of quack after each line.
int quack = 2; quack += 5; quack *= 10; quack -= 6; quack /= 8; quack %;= 3;
What output would the following loop produce?
for ( value = 36; value > 0; value /=2) printf("%3d", value);
Represent each of the following test conditions:
x is greater than 5.
scanf() attempts to read a single double (called x) and fails.
x has the value 5.
Represent each of the following test conditions:
scanf() succeeds in reading a single integer __________________________
x is not 5 ____________________
x is 20 or greater ___________________________
You suspect that the following program is not perfect. What errors can you find?
#include <stdio.h> int main(void) { /* line 3 */ int i, j, list(10); /* line ...
Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.