# CIS 1500 Study Guide - Final Guide: Spaghetti Code, C Mathematical Functions, Evry

331 views6 pages
Exam review
5. true or false – a question like this will 100% be on the exam ! --- the type changes during the
operation changing the suspected outcome to an integer. The number trumps to an integer BUT DOES
NOT ROUND!! Therefore if it was 3.9000 it would not equal 13.. still 12
Int M;
Double e = 9.0
M = e+ 3.14159
M = 12;
6. in the statement: true or false?
Int k;
K = 1/3+1/3+1/3
K is equal to 1
False k = 0 bc integer 1 divided by integer 3 = 0
7. the correct way of calculating 2^n is, and assigning its value to x is :
a) x = 2* n;
b) x= 2 ^ n; --this doesn’t exist dumbass!
c) x = pow(2,n);
d) x = 2n;
8. the math function ‘exp’ is used to:
a) perform exponentiation e.g 2^n
b) calculate the exponential of a number
c) print a num in exponential form
d) all of the above
9. a float is diff from a double how?
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

a) float only has single precision
b) double takes up more space
c) float is more susceptible to errors such as rounding
d) all of the above
10. from which function does evry c program start?
A) main
b) #include
c) <stdio.h>
d) return
11. a divide by zero error occurs:
a) compile time
b) at excecution time
c) at preprocessor time
d) none
12. the reason for indentations is:
a) to provide the compiler with neat code
b) to improve readabliliby to humans
c) to increase whitespace
d) all of the above
13. what are the basic datatypes in C
a) int, single, doublem char
b) int, real, Boolean, char
c) int, float, double , char
d) long, long long, double double
14. which of the following represents B = 30000e^-0.032t
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.