Question

5. Which one of the following statements declares a c-string variable? a.char c; b. string s;...

5. Which one of the following statements declares a c-string variable?

a.char c;

b. string s;

c. char c[10];

d.string s[10];

6. ________________ function returns the uppercase version of expression.

a. tolower(expression);

b. upper(expression)

c. toupper(expression);

d. isupper(expression);

7. Which of the following creates a string object with data ‘csci-1410’?

a. string str;

b. string ‘csci-1410’;

c. string s("csci-1410");

d. string s(csci-1410);

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C does not support string at datatype, to fore string use character array To char c [101 is answer (c). is Inc, toupper Expre

Add a comment
Know the answer?
Add Answer to:
5. Which one of the following statements declares a c-string variable? a.char c; b. string s;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Multiple choice questions 1. A variable that is shared by all objects of a class is...

    Multiple choice questions 1. A variable that is shared by all objects of a class is called_________? A.Static variable B. Const variable C.Member variable D. None of the above 2. Each object of a class has its own copy of the class's: A. member functions B. static member variables C. instance member variables D. A & C E. A & B 3. In a vector, which of the following statements is true? (can have multiple answers) a) Indexing vector access...

  • C++ programing Which of the following statements (a-d) are true if the following lines of code...

    C++ programing Which of the following statements (a-d) are true if the following lines of code are executed? int G = 17; int &H = G; A. H is now an alternate name for G B. Adding 1 to H will change the value of G to 18 C. Subtracting 5 from G and printing H will display the value 12 D. The condition H == G will give a true result E. All of the statements (a-d) are true...

  • Using C, Write a function reverse which takes a string as an argument, reverses the string...

    Using C, Write a function reverse which takes a string as an argument, reverses the string and returns the reversed string. Note; you should not return a string that you created inside the reverse function! For example: Test char str[]-"hello" printf("%s", reverse (str)); Result olleh

  • #include <iostream> #include <cstring> #include <string> #include <istream> using namespace std; //Function prototypes int numVowels(char *str);...

    #include <iostream> #include <cstring> #include <string> #include <istream> using namespace std; //Function prototypes int numVowels(char *str); int numConsonants(char *str); int main() {    char string[100];    char inputChoice, choice[2];    int vowelTotal, consonantTotal;    //Input a string    cout << "Enter a string: " << endl;    cin.getline(string, 100);       do    {        //Displays the Menu        cout << "   (A) Count the number of vowels in the string"<<endl;        cout << "   (B) Count...

  • #include <iostream> #include <cstring> #include <string> #include <istream> using namespace std; //Function prototypes int numVowels(char *str);...

    #include <iostream> #include <cstring> #include <string> #include <istream> using namespace std; //Function prototypes int numVowels(char *str); int numConsonants(char *str); int main() {    char string[100];    char inputChoice, choice[2];    int vowelTotal, consonantTotal;    //Input a string    cout << "Enter a string: " << endl;    cin.getline(string, 100);       do    {        //Displays the Menu        cout << "   (A) Count the number of vowels in the string"<<endl;        cout << "   (B) Count...

  • Question 39 (1 point) Which one of the following statements can be used to get the...

    Question 39 (1 point) Which one of the following statements can be used to get the fifth character from a string str? char c - str.charAt(4): char c - str[5]: char c = str(4): char c - str.charAt(5): Question 40 (1 point) What does the following statement sequence print If the user input is 1234 public static void main(String args) Scanner in new Scanner (System.in); System.out.print("Enter a number: "); String strin.next( St 456; System.out.println(str) Compile-time error 123456 579 Run-time error

  • Write C programs named mystring.h and mystring.c, containing the headers and implementations of the following functions....

    Write C programs named mystring.h and mystring.c, containing the headers and implementations of the following functions. int letter_count(char *s) computes and returns the number of English letters in string s. int word_count(char *s) computes and returns the number of words in string s. void lower_case(char *s) changes upper case to lower case of string s. void trim(char *s) removes the unnecessary empty spaces of string s. mystring.h #include <stdio.h> int letter_count(char *); void lower_case(char *); int word_count(char *); void trim(char...

  • In C# (sharp) Assuming a string variable named movie Title has already been declared, which one...

    In C# (sharp) Assuming a string variable named movie Title has already been declared, which one of the following statements combines the strings "Hidden" and "Figures" and then assigns the resulting string to the variable? 1. movieTitle="Hidden" + "Figures"; 2. "Hidden" +"Figures" - moveTitle; 3. movie Title("Hidden" +"Figures"); 4. movie title="Hidden" & "Figures": Look at the following code: int distance; // Declare distance as an int double half://Declare half as a double distance = 35; // Assign 35 to distance...

  • c. [3 marks] Given the following definition of the class MyClass, class MyClass { String s...

    c. [3 marks] Given the following definition of the class MyClass, class MyClass { String s int z Myclass(int y) { z = y } } fill in the blanks (labelled i., ii. and iii.) in the definition of the method main, of the class StringProcessing, with i. a declaration of a variable named obj of type MyClass, initialised with a MyClass object so that its instance variable z has a value of 20, ii. an assignment of the instance...

  • Question 15 Which of the following statements will convert the string, str = "285" to an...

    Question 15 Which of the following statements will convert the string, str = "285" to an int? A int x = str; B int x = Integer.integer(str); C int x = Integer.parseInteger(str); D int x = Integer.parseInt(str);

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT