Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Using Cic Declare Three Integer Variables Eg B C Main Assign Thei Values Standard Input Ci Q35541542

answer only question 3. thanks
Using CIC++, declare three integer variables (e.g. A, B, C) in main) and assign thei values from standard input (cin). Then,Using CIC++, declare three integer variables (e.g. A, B, C) in main) and assign thei values from standard input (cin). Then, call a function swap10 to swap their values through pointers (e.g. A, B, C are 4, 5, and 6, after calling swap0, A has B’s value 5 B has C’s value 6, and C has A’s value 4), and output A, B, and C; finally, define another function swap2 to swap A, B, C one more time using references. Note: to swap A, B, C by pointers; the swap function needs to have three pointer 2. Using CIC++, define an integer pointer in main), and use this pointer to dynamically range [0, 999]. Then, pass the array as parameter(s) to a function prime_count() arguments which are initialized with the address of A, B, C defined above. allocate an integer array with 50 elements; assign the array with random numbers in which counts the number of the integers that are prime, and prints those integers; after the function call, print the “counter” result; finally, use delete to deallocate the array memories. Note that you need to define a Boolean function prime() which tells whether an integer is prime or not. This function will be called and used by prime_count() to tell whether the numbers in the array are prime or not 3. Redo programs of 1 and 2 by using separate header and source files: declaring the functions in header files, and implementing functions in source files. Show transcribed image text Using CIC++, declare three integer variables (e.g. A, B, C) in main) and assign thei values from standard input (cin). Then, call a function swap10 to swap their values through pointers (e.g. A, B, C are 4, 5, and 6, after calling swap0, A has B’s value 5 B has C’s value 6, and C has A’s value 4), and output A, B, and C; finally, define another function swap2 to swap A, B, C one more time using references. Note: to swap A, B, C by pointers; the swap function needs to have three pointer 2. Using CIC++, define an integer pointer in main), and use this pointer to dynamically range [0, 999]. Then, pass the array as parameter(s) to a function prime_count() arguments which are initialized with the address of A, B, C defined above. allocate an integer array with 50 elements; assign the array with random numbers in which counts the number of the integers that are prime, and prints those integers; after the function call, print the “counter” result; finally, use delete to deallocate the array memories. Note that you need to define a Boolean function prime() which tells whether an integer is prime or not. This function will be called and used by prime_count() to tell whether the numbers in the array are prime or not 3. Redo programs of 1 and 2 by using separate header and source files: declaring the functions in header files, and implementing functions in source files.

Leave a Reply

Your email address will not be published. Required fields are marked *