What do you include if you have to use math functions in a program?
#include<cmath>
True or false â Strings are written in single quotes(âxyzâ).
False
What is the purpose of binary?
The computer only understands 0s and 1s so every character is converted into binary for the computer to read.
The ____ function, in the C standard library, returns a random integer each time the function is called, in the range 0 to RAND_MAX.
rand()
Give an example of pow() function?
pow(2,3) = 2^3
What are the two ways of inputting a string?
cin way and the getline way
True or False â Binary numbers consist of 1 and 2.
False
How can you produce random numbers from 0 to 10? (including 10)
rand()%11
What is the output of fabs(99.108)?
99.108
What is the syntax of declaring a character variable?
char variableName;
Is the binary of 7 = 111?
Yes
Explain how we can produce random numbers between a range? (Is there a formula for it)
From x to y
[rand() % (x - y)] + x
What is the output of ceil(7.2)?
8.0
Name all the escape sequences.
/n,/t,/',/",//
What is the decimal value for 1101?
13
The function ____ returns the number of seconds since Jan 1, 1970.
time()
What is the output of floor(-2.4)?
-3.0
What is the purpose of escape sequences?
To have the symbols (that already have meaning) as characters.
What is the binary value of 16?
10000
Write a segment of code to find random numbers between 9 to 99.
[rand() % 90] + 9