100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CSE220 FINAL EXAM QUESTIONS AND ANSWERS

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
29-01-2025
Written in
2024/2025

CSE220 FINAL EXAM QUESTIONS AND ANSWERS C/C++ has 2 pointer operators, which operator represents the name of an address? (Commonly referred as l-value) - ANSWERS Asterisk (*) Multiple pointers can reference the same objects - ANSWERS True Given this snippet of code, determine which of the following options will change the test in array to "Hello Doe" after execution. char array[] = "Hello Joe"; char *x; - ANSWERS a. x = array; *(x + 6) = 'D'; d. x = &array[0]; x = x + 6; *x = 'D'; Given this snippet of code, what is the value of x after executing the last statement? int x = 10, *y, **z; y = &x; z = &y; **z = 1000; - ANSWERS 1000 A pointer variable can take the address of a memory location as its value. Read the given program: #include <stdio.h> main(){ int a = 20; b = 30; *p, *q, **r; p = &a; *p = 50; q = &b; *q = 70; r = &p; **r = 90; printf("%dn", a); printf("%dn", b); a = 20; b = 80; printf("%dn", **r); Answer the following three questions. 1.The output of the 1st printf statement is 50 . 2. The output of the 2nd printf statement is 70 . 3.The output of the 3rd printf statement is 90 . - ANSWERS a. 90 b. 70 c. 20 What data types in C have the same data range, assuming the computer used is a 32bit computer? - ANSWERS pointer type and unsigned in

Show more Read less
Institution
CSE220 F
Course
CSE220 F










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CSE220 F
Course
CSE220 F

Document information

Uploaded on
January 29, 2025
Number of pages
17
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CSE220 FINAL EXAM QUESTIONS AND
ANSWERS

C/C++ has 2 pointer operators, which operator represents the name of an
address? (Commonly referred as l-value) - ANSWERS Asterisk (*)


Multiple pointers can reference the same objects - ANSWERS True


Given this snippet of code, determine which of the following options will change
the test in array to "Hello Doe" after execution.
char array[] = "Hello Joe";
char *x; - ANSWERS a. x = array;
*(x + 6) = 'D';
d. x = &array[0];
x = x + 6;
*x = 'D';


Given this snippet of code, what is the value of x after executing the last
statement?
int x = 10, *y, **z;
y = &x;
z = &y;
**z = 1000; - ANSWERS 1000

, A pointer variable can take the address of a memory location as its value. Read
the given program:
#include <stdio.h>
main(){
int a = 20; b = 30; *p, *q, **r;
p = &a;
*p = 50;
q = &b;
*q = 70;
r = &p;
**r = 90;
printf("%d\n", a);
printf("%d\n", b);
a = 20;
b = 80;
printf("%d\n", **r);
Answer the following three questions.
1.The output of the 1st printf statement is 50 .
2. The output of the 2nd printf statement is 70 .
3.The output of the 3rd printf statement is 90 . - ANSWERS a. 90
b. 70
c. 20


What data types in C have the same data range, assuming the computer used is a
32bit computer? - ANSWERS pointer type and unsigned int

, Given the following code, what will happen? :
char a[] = {'c', 'a', 't', '\0'}; char *p = a; while (*p != 0) { *p = *p + 1; printf("%c",
*p++); // *p++ is the same as *(p++) } - ANSWERS It prints: dbu


Given the following code, what will happen? :
char *p = "hello", *s = "this is a string";strcpy(p, s); printf("%s\n", p); - ANSWERS A
compilation error will occur at this line: strcpy(p,s);


Given the following union type definition in a 32bit computer:
union person {
char gender;
int age;
char name[16];
} x;


What is the total number of bytes used by the variable x? - ANSWERS 16


The tail variable in an array of structures is used for indicating - ANSWERS a. how
far the search() function should go in searching the items of the array
b. where to insert a new item, if the items in the array do not need to be sorted


Consider the following snippet of code in a 32bit computer:
#define max 10
struct contact {

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
osorebrilliant Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
453
Member since
2 year
Number of followers
368
Documents
4719
Last sold
1 week ago
EXCELLENT HOMEWORK HELP AND TUTORING ,ALL KIND OF QUIZ AND EXAMS WITH GUARANTEE OF A EXCELLENT HOMEWORK HELP AND TUTORING ,ALL KIND OF QUIZ AND EXAMS WITH GUARANTEE OF A Am an expert on major courses especially; psychology,Nursing, Human resource Manageme

EXCELLENT HOMEWORK HELP AND TUTORING ,ALL KIND OF QUIZ AND EXAMS WITH GUARANTEE OF A EXCELLENT HOMEWORK HELP AND TUTORING ,ALL KIND OF QUIZ AND EXAMS WITH GUARANTEE OF A Am an expert on major courses especially; psychology,Nursing, Human resource Management and Mathemtics Assisting students with quality work is my first priority. I ensure scholarly standards in my documents and that\'s why i\'m one of the BEST GOLD RATED TUTORS in STUVIA. I assure a GOOD GRADE if you will use my work.

Read more Read less
3.6

76 reviews

5
32
4
13
3
13
2
3
1
15

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions