M4ritimeSeeker

Kahoot Week 11 Strings Answers

Apr 6th, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. WEEK 11 KAHOOT QUESTIONS AND ANSWERS
  2.  
  3. 1) What is a string?
  4. - An array of characters
  5.  
  6. 2) Which of the following is a correct declaration of a CHARACTER variable?
  7. - char var1 = 'a';
  8.  
  9. 3) What chart contains all of character symbols that your computer can process?
  10. - ASCII and Unicode
  11.  
  12. 4) What is an input buffer?
  13. - A data location for incoming input before it is processed
  14.  
  15. 5) Which of the following is a legal character function?
  16. - isalpha(character);
  17.  
  18. 6) Which character function tests if the character is uppercase?
  19. - isupper(character);
  20.  
  21. 7) All strings ends with a "\n" character.
  22. - False
  23.  
  24. 8) Which of the following are legal string declarations?
  25. - char aString[] = "string";
  26.  
  27. 9) What is the difference between a string and an array of characters?
  28. - The null (\0) character
  29.  
  30. 10) Are these strings the same? char anAry[] = "This is a string"; AND char* anAryPtr = "This is a string";
  31. - True
  32.  
  33. 11) Which of the two functions will return the total size of the string (including the null character)?
  34. - sizeof(string);
  35.  
  36. 12) What library do we need to include to use strings/string functions?
  37. - #include <string.h>
  38.  
  39. 13) What library do we need to include to use character functions?
  40. - #include <ctype.h>
  41.  
  42. 14) Which of the two functions will return the length of the string not including the "\0"?
  43. - strlen(string);
  44.  
  45. 15) What format specifier in printf() is used to print strings?
  46. - %s
Advertisement
Add Comment
Please, Sign In to add comment