6/20/2010

Tugasan 3 DCT1033

1. Write a function named kira that have three arguments, prints the sum, the average and product. The function calling should be as follows

a=13;
b=27;
c=14;
kira(a,b,c);

and the following output should be displayed by function kira.

Sum is 54
Average is 18
Product is 4914




2. Write a function named mutlak that computes and return the absolute difference of its two arguments, where the absolute difference of A and B is A – B if A is greater than B and B –A if B is greater than A. The function calling should be as follows




and the following output should be displayed by function mutlak.

4


3. Write a program to read 20 data items into two arrays, x and y, of size 10. Store the product of the corresponding elements of x and y in a third array z, also of size 10. Print a three column table displaying the array x,y and z. Then compute and print the sum of the item in Z.

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...