Write a program that must open a file of exactly 33 ints. a. Write a function pr
ID: 3652948 • Letter: W
Question
Write a program that must open a file of exactly 33 ints. a. Write a function printme that prints the contents of an array of ints. b. Write a function oddvalues that prints just the odd ints in an array. c. Write a function oddlocations that prints the indices of the odd ints in an array. d. Write a function countodd that prints the number of odd ints in an array. e. Write a function addme that adds and prints the sum of the ints in an array. f. Write a function findsmall that prints the first index of the smallest int in an array. g. Write a function findlarge that prints the last index of the largest int in an array. h. Write a function searchme that searches and prints true if sv (search value) is in an array and false otherwise (can use a version from the book) i. Write a function sortme that sorts an array (use SelectionSort). j. Write a function binarysearch that searches and returns true if sv is in a sorted array and false otherwise a. The contents of the array are the ints:.................. b. The odd values of the array are: ................... c. The odd locations of the array are:....................... d. The number of odd numbers is:.................. e. The sum of the ints is:.................. f. The first index of the smallest int is............. g. The last index of the largest int is........... h. The value searched was .... and it was or . i. The sorted array is:................. j. The value searched in the sorted array was .......and it was orExplanation / Answer
/* This code works for 10 emements ...you may se the index values.*/ #include#include void printme(int[10]); void oddvalues(int[10]); void oddlocation(int[10]); void countodd(int[10]); void addme(int[10]); void findsmall(int[10]); void findlarge(int[10]); void searchme(int[10],int); void sortme(int[10]); void binarysearch(int[10],int); void main() { int array[10]={4,58,23,848,2,51,98,55,11,44}; int search; int value; clrscr(); printf(" Content of the array :"); printme(array); printf(" Odd Values of the array : "); oddvalues(array); printf(" Odd Location of the array : "); oddlocation(array); printf(" Number Of odd number is : "); countodd(array); printf(" Sum of ints is :"); addme(array); printf(" The first index of the smallest int is :"); findsmall(array); printf(" The last index of the largest int is :"); findlarge(array); printf(" Enter the search value :"); scanf("%d",&search); searchme(array,search); printf(" The sorted array is :"); sortme(array); binarysearch(array,search); getch(); } void printme(int a[10]) { int i; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.