반응형 function2 5. Array and Functions[C Basic] 5.1. Write a program that produces 20 random numbers between 1 and 20. The program should store all non-duplicate values in an array (s.t., first value in Array[0], second value in Array[1], …) Use a single array to accomplish this task. #include #include #include int check_array(int array[],int i){ int j; for(j=0;j 2021. 11. 7. 4. Function[C Basic] 4.1. Define a function ‘hypotenuse’ that calculates the length of the hypotenuse of a right triangle when the other two sides are given The function should take two argument of type double and return the hypotenuse as a double #include #include double hypotenuse(double side1, double side2); int main() { int i; double n1, n2; for (i = 0;i < 3;i++) { printf("Enter the sides of the triangle : "); s.. 2021. 11. 7. 이전 1 다음 반응형