Starting from:
$30

$24

Assignment 6: Functions SOlution




Programs:




Write a program to swap two elements using call by value and call by reference. Take the two input numbers from the user. Use function named swap to swap the elements and call it in the main function. Also write down in your own lines in the comments what you have understood about call by value and call by reference.



Write a program that asks the user to enter a series of integers (which it stores in an array), then sorts the integers by calling the function selection_sort. When given an array of n elements, selection_sort must do the following:



Search the array to find the largest element, then move it to the last position in the array.



Call itself recursively to sort the first n-1 elements of the array.



Write a program in C to find the sum of the series 1!/1+2!/2+3!/3+4!/4+5!/5 using the function.






Write pseudocode to solve the given problems.

Write C program to solve the above problems. Name your file Lab6_YourName.c

More products