Write a program that does the following: Declare an array of 10 integer values and pass the array to a function in which you have the user enter 10 integers which you save in the array (you should use a loop here). Next, use a second function to print out all 10 values the user has entered.
Compile and run the code below in your own C environment.
#include <stdio.h>
#define NUM 10
// prototypes here
int main(void) {
int array[NUM];
fillArray(array);
printArray(array);
return 0;
}
// function definitions here
Write a program that declares an array of 100 floats. Then call a function, to which you pass the array, which fills the array with the square roots of the numbers 1 - 100. Next, call another function to print the numbers stored in the array in the following form:
Compile and run the code below in your own C environment.
#include <stdio.h>
#include <math.h>
// prototypes here
int main(void) {
float array[100];
fillWithSquareRoots(array);
printArray(array);
return(0);
}
// function definitions here
Write a program that prompts the user to type in a sentence, and that reads the sentence, character by character, and stores it in an array of characters. Stop reading, when the array is full or the character read is \n. Next, print out the sentence in reverse. Your program should use two functions: one function to read from the user input the relevant sentence, and another function to print the sentence in reverse. Youβll also need to think about passing along the length of the sentence entered by the user.
Compile and run the code below in your own C environment.
#include <stdio.h>
#define NUM 100
// prototypes here
int main(void){
char array[NUM];
int length;
enterPhrase(array, &length);
printPhrase(array, length);
return 0;
}
// function definitions here