Lab Assignment 01
Lab Assignment 01
Popular in Course
verified elite notetaker
Popular in Department
This 2 page Study Guide was uploaded by Usman Qureshi on Wednesday November 18, 2015. The Study Guide belongs to a course at a university taught by a professor in Fall. Since its upload, it has received 19 views.
Reviews for Lab Assignment 01
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 11/18/15
Riphah International University Islamabad Course Code CSZOlS Fall 2015 Course Title Data Structure and Algorithm Activity Type Lab Tasks Objective Basic concepts Pointers 1 Write a C program that a b 2 Repeat above example with integer array and integer pointer Declare array of type char eg char chArray5 IIIII39IIII o u Declare a pointer of type character eg charchPtr and assign the reference of chArray to it Use for loop that each time print the value occupied by chPtr and then increment the chPtr by 1 3 Write a program that a Contains a function printArraychar pointer int size b Define a character array and character pointer in the main function similar to Question C 1 Call printArray function and pass character pointer to it as a function argument The printArray function should print entire values by using for loop similar to Question 1 4 Write a program where you a C Define integer array int iArray525436 b Define a function void incrementArrayValuesint array int size The function shall use for loop and increment each value of an array by one and then print the result Use another for loop in the main function and print iArray 5 Write a program where you Define two character arrays each of size 5 b Define concatenate function char concatchar arg1 int sizel char arg2 int size2 The function should concatenate the two arrays and return the result Inside main function write a syntax char result concatarray15array25 Now use a C for loop and print each value occupied by result 6 Write a class Person with attribute agedouble Also write a default constructor of Person where you assign age value as 40 a Inside main function write following code and then express your observation Person valueTypePerson Person renypePersonnew Person Person valueTypePersonl valueTypePerson Person renypePersonl renypePerson coutltlt increment value type and print result valueTypePersonlagelOO coutltlt valueTypePersonage coutltlt valueTypePersonlage coutltlt increment reference type and print result renypePersonlagelOO coutltlt renypePersonage coutltlt renype Person lage coutltlt write your observation in this statement
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'