Department of Computer Engineering
Computer Programming 66111
HW2
Dead Line Q1, Q2
20/11/2012 Thursday
Q1: Write a complete C/C++ program to do the following:
1-Define static array called A of size 8 of type double, read all elements from keyboard then compute and print the product of all elements that found in odd indices
[1,3,5….]
2-Define two dynamic arrays called B and C of size 5 of type character, read all elements from keyboard then compute:
The count of occurrence of vowels (‘a’,’u‘,’i’,’e’) in both array B and C.
Replace all capital letters of array C with ‘#’
Fill a new dynamically allocated array called D from only the small letters in both arrays B and C .
Q2: Write a function that takes an integer m as a parameter then return the following sum. Y m
4
Sum= (2 *Y 100 )
Y 1
Good Luck