.In general, use lower case letters for variable names. Variable names should be
ID: 3743634 • Letter: #
Question
.In general, use lower case letters for variable names. Variable names should be mnemonic (i.e., somewhat intuitive). Separate words within a variable name with an underscore or begin the second word with an uppercase letter Indent 2-4 spaces (optimally 4) within main. The editor should take care of proper indenting Place no more than one C statement per line Do not type more than 80 characters per line Program: 1. Write a C program that does the following a. Declare a string variable (char array) of size 10 (to store a string up to 9 characters plus a 10 at the end). Note: An array of size 10 will have indices of 0-9 b. Display a message to the user that this program prints specific characters within a user-entered string c. Ask the user to enter a string of 9 characters or less. d. Output the following Character 0 is: Character 4 is: Character 8 is: The program should compile without error and rurn gracefully Test with the input: Engineers For the submitted screen capture, run the program with the above value. (Feel free to try other values, but you don't have to submit those.)Explanation / Answer
#include int main() { // a char array[10]; // b printf("This program prints specific characters within a string you enter "); // c printf("Ener a string of 9 characters or less: "); // d scanf("%s", array); printf("Character 0 is: %c ", array[0]); printf("Character 4 is: %c ", array[4]); printf("Character 8 is: %c ", array[8]); return 0; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.