Time left 0:4 Assume the following declarations: char name [21]; char yourName [21]; char studentName [31]; Select the following statements that are valid. (Assume that the variables have been given values.) Select one or more: Ocin >> name; O bool x = strcmp (yourName, studentName); O yourName = studentName; O if (yourName name) studentName = name; cout << studentName; Ostrcpy (studentName, Name); O yourName [0] = '\0';

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 36SA
icon
Related questions
Question
Time left 0:48:5
Assume the following declarations:
char name [21];
char yourName [21];
char studentName [31];
Select the following statements that are valid. (Assume that the variables have been given
values.)
Select one or more:
O cin >> name;
O bool x = strcmp (yourName, studentName);
O yourName = studentName;
O if (yourName == name)
studentName = name;
cout << studentName;
Ostrcpy (studentName, Name);
O yourName [0] = '\0';
Transcribed Image Text:Time left 0:48:5 Assume the following declarations: char name [21]; char yourName [21]; char studentName [31]; Select the following statements that are valid. (Assume that the variables have been given values.) Select one or more: O cin >> name; O bool x = strcmp (yourName, studentName); O yourName = studentName; O if (yourName == name) studentName = name; cout << studentName; Ostrcpy (studentName, Name); O yourName [0] = '\0';
What is the output of the following code when embedded in a complete C++
int
another (int a, int b)
{
int i, j=0;
for (i = a; i <= b; i++)
j = j + i;
return j;
int x = 5, y = 8;
cout << another (x, y) << endl;
return 0;
}
(Type ERROR if the program contains error(s) and won't run.)
Answer:
}
int main()
{
Time left 0:48:43
Transcribed Image Text:What is the output of the following code when embedded in a complete C++ int another (int a, int b) { int i, j=0; for (i = a; i <= b; i++) j = j + i; return j; int x = 5, y = 8; cout << another (x, y) << endl; return 0; } (Type ERROR if the program contains error(s) and won't run.) Answer: } int main() { Time left 0:48:43
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning