

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Declare a floating point variable named average. - correct answerfloat average; Declare a variable named message that is large enough to store all the upper-case letters of the english alphabet. - correct answerchar message[26]; Declare an integer array that can store 50 elements. - correct answerint array[50]; Describe how you would strip off the "\n" in a string - correct answerfgets(input, MAX_SIZE, stdin); int len= strlen(input); input [len-1] = 0;` Describe the purpose of "cd ~" - correct answerChanges the directory to your home directory Describe the purpose of "ls -l" - correct answerlong listing; lists more details about the files Describe the purpose of "pwd" - correct answer"print working directory" Shows what directory you are currently in Describe the purpose of "rm grades.txt" - correct answerremoves the file grades.txt. Once it is removed it is gone forever. Does C have a built-in string type? - correct answerNo, there is no built in string type in C. A string in C is simply an array of characters. Give the function prototype for a function named range that takes two integer arguments and returns a floating point value. - correct answerfloat range = (int a, int b); Given 3 integer variables, a, b, and c, compute the real average of the integer values in the 3 variables and store the result in the floating-point variable average. - correct answeraverage = (a+b+c)/3.0; How are strings represented/stored in C? - correct answerStrings are stored as characters in an array. The string is terminated by the null character \
Provide the logical expression that determines if the value of the integer variable grade is between and including 0 and 100. - correct answergrade >= 0 && grade <= 100; Read an integer value from the user via the keyboard into the integer variable value, which has already been declared. - correct answerscanf("%d", &value); Standard input is ______ - correct answerthe keyboard What are the 3 parts a loop must contain? - correct answerInitialization, Condition, Modification What does a function with "void" return? - correct answerNothing What is meant by the current working directory? - correct answerThe directory you are currently using at that time in the terminal. What is the command to make the lab4 sub directory the working directory (already in the cs212 directory) - correct answercd lab What is the difference between an int data type and the unsigned int data type? - correct answerint data types can be determined whether they are positive or negative. unsigned int data types do not provide that information. What is the purpose of "#include <string.h>" - correct answerThis is a header (similar to import in python language) The program needs it in order for it to run, represents the functions needed. What is the purpose of "strchr" - correct answerSearches for a particular character in a string (int strchr(char str[], char ch); What is the purpose of "strcmp" - correct answerReturns an integer. If the two strings are equal it returns a 0. if the first is before the second (in alphabetical order) it returns negative number. If the first is after the second (in alphabetical order) it returns a positive int