1. For float f=60000.0, which one best describes f*f? (b) f*f< 0, (a) f*f>0, (c) f*f>= 0, (d) f*f<= 0, (e) none of the above 2. For int i=6000, which one best describes i*i? (b) і*i< 0, (a) i*i> 0, (c) i*i>= 0, (d) i*i<= 0, (e) none of the above 3. For int i=60000, which one best describes i*i? (a) i*i> 0, (b) i*i< 0, (c) i*i>= 0, (d) i*i<= 0, (e) none of the above 4. Consider: int six=123, siy=456, siz=789; Let v=((six+siy)+siz) and w=(six+(siy+siz)). Which one best describes the relationship between v and w? (a) v = w, (b) v!=w, (c) v > w, (d) v < w, (e) none of the above 5. Consider: float fx=12.34, fy=+1.0e+30, fz=-1.0e+30; Let v=((fx+fy)+fz) and w=(fx+(fy+fz)). Which one best describes the relationship between v and w? (a) v = w, (b) v!=w, (c) v >= w, (d) v <= w, (e) none of the above 6. When the following loop is executed: for (i=0;i<10;i++) d = fun(i); what is the earliest iteration that can start triggering "Segmentation fault (core dumped)" when compiled without stack protector? (a)2, (b)3, (c)4, (d)5, (e) none of the above double fun(int i) { typedef struct { int a[4]; double d; volatile struct_t s; s.d = 3.14; s.a[i] = 1073741824; return s.d; } } struct_t;

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
w=7 means the total number of bits is 7. If it says w=8, the total number of bits in the number system is 8.
1. For float f=60000.0, which one best describes f*f?
(b) f*f< 0,
(a) f*f> 0,
(c) f*f>= 0,
(d) f*f<= 0,
(e) none of the above
2. For int i=6000, which one best describes i*i?
(b) i*i< 0,
(a) i*i> 0,
(c) i*i>= 0,
(d) i*i<= 0,
(e) none of the above
3. For int i=60000, which one best describes i*i?
(b) i*i< 0,
(a) i*i> 0,
(c) i*i >= 0,
(d) i*i<= 0,
(e) none of the above
4. Consider: int six=123, siy=456, siz=789; Let v=((six+siy)+siz) and w=(six+(siy+siz)). Which one best
describes the relationship between v and w?
(a) v = w,
(b) v!=w,
(c) v > w,
(d) v < w,
(e) none of the above
5. Consider: float fx=12.34, fy=+1.0e+30, fz=-1.0e+30; Let v=((fx+fy)+fz) and w=(fx+(fy+fz)). Which
one best describes the relationship between v and w?
(a) v = w,
(b) v!=w,
(c) v >= w,
(d) v <= w,
(e) none of the above
6. When the following loop is executed: for (i=0;i<10;i++) d = fun(i); what is the earliest iteration that
can start triggering "Segmentation fault (core dumped)" when compiled without stack protector?
(a)2,
(b)3,
(c)4,
(d)5,
(e) none of the above
typedef struct {
int a[4];
double d;
double fun(int i) {
volatile struct t s;
s.d = 3.14;
s.a[i] = 1073741824;
return s.d;
}
} struct_t;
Transcribed Image Text:w=7 means the total number of bits is 7. If it says w=8, the total number of bits in the number system is 8. 1. For float f=60000.0, which one best describes f*f? (b) f*f< 0, (a) f*f> 0, (c) f*f>= 0, (d) f*f<= 0, (e) none of the above 2. For int i=6000, which one best describes i*i? (b) i*i< 0, (a) i*i> 0, (c) i*i>= 0, (d) i*i<= 0, (e) none of the above 3. For int i=60000, which one best describes i*i? (b) i*i< 0, (a) i*i> 0, (c) i*i >= 0, (d) i*i<= 0, (e) none of the above 4. Consider: int six=123, siy=456, siz=789; Let v=((six+siy)+siz) and w=(six+(siy+siz)). Which one best describes the relationship between v and w? (a) v = w, (b) v!=w, (c) v > w, (d) v < w, (e) none of the above 5. Consider: float fx=12.34, fy=+1.0e+30, fz=-1.0e+30; Let v=((fx+fy)+fz) and w=(fx+(fy+fz)). Which one best describes the relationship between v and w? (a) v = w, (b) v!=w, (c) v >= w, (d) v <= w, (e) none of the above 6. When the following loop is executed: for (i=0;i<10;i++) d = fun(i); what is the earliest iteration that can start triggering "Segmentation fault (core dumped)" when compiled without stack protector? (a)2, (b)3, (c)4, (d)5, (e) none of the above typedef struct { int a[4]; double d; double fun(int i) { volatile struct t s; s.d = 3.14; s.a[i] = 1073741824; return s.d; } } struct_t;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning