GNG 1106 Final: GNG1106 Final Exam 2008 Fall Solutions

432 views11 pages

Document Summary

The total number of points for the examination is 50. Use both sides of these sheets if necessary. Part 1 short answer questions (a) what is the main difference between a c array and a c structure? (2 points). #define radius 30 char *str; (c) write the c declaration of variable str which is a pointer to a character string. (1 point) (d) define a c structure named student with the following members: studentnumber, studentname, grade, and coursecode. Define a new type student that represents the c student structure. (2 points) C code struct student unsigned int strudentnumber; char studentname[50]; double grade; char coursecode[20]; typedef struct student student; 2 (e) provide the output of the following c code in the adjacent box. (2 points) Output screen (f) write a c function swap() that receives two addresses (to two integer values) in its parameters (two pointers) and swaps the values pointed to by the pointers.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents