6 ans:
output:
57 80
80 80
7 ans:
8 ans:
sunny cloudy
cloudy cloudy
It's a C++ code. 2. Answer the following questions in a word document. 6. What is...
Give the output for the following C code, assuming strl is located at address 100 and str2 is located at address 200: (If no output, enter 'nothing! Enterunknown' if cannot be determined.) char stri[] = "Swinney"; char str2[] = "win"; int main(void) { int k; k = (int) strstr(&str1[2] , &str2(11): printf("%d", k); }
What is the output of the following code snippet? (If there is some kind of syntax error indicate this by marking "error" in your answer choice) 1. int fly = 5; int x; if (fly-- > 5) x = 5; else x = 2; if (x++ > 3) cout << x; cout << fly << endl; 2. int i = 0; bool b = i == 0 || i++ > 0; if (!b) cout << i << endl; else cout...
QUESTION 1 What is the output of the following code snippet? int main() { bool attendance = false; string str = "Unknown"; attendance = !(attendance); if (!attendance) { str = "False"; } if (attendance) { attendance = false; } if (attendance) { str = "True"; } else { str = "Maybe"; } cout << str << endl; return 0; } False True Unknown Maybe QUESTION 2 What is the output of the following code snippet? #include <iostream> #include <string> using...
51. What is the output of the following code snippet? int number = 0; int ptr_num -&number ptr_num 60; number-80 cout < "ptr num << endl b, 60 c. 80 d. the address of number Answer 52. What is the output of the following code snippet? double num-0.0; double* ptr = # num = 15.0; ptr ptr 15.0 cout << num <<"ptr <<endl; a. 15 15 b. 15 30 С. 30 15 d. 30 30 Answer: 53. What is the...
Using C++ Use the below program. Fill in the code for the 2 functions. The expected output should be: The:fox:jumps:over:the:fence.: The:fox:jumps:over:the:fence.: The:fox:jumps:over:the:fence.: The:fox:jumps:over:the:fence.: #include #include #include using namespace std; //Assume a line is less than 256 //Prints the characters in the string str1 from beginIndex //and inclusing endIndex void printSubString( const char* str1 , int beginIndex, int endIndex ) { } void printWordsInAString( const char* str1 ) { } int main() { char str1[] = "The fox jumps over the...
What is the output of the following C++ code? int count = 1; int num = 25; while (count < 25) { num--; count++; } cout << count « " " « num << endl i 25 1 0 24 1 0 25 0 0 24 0 In this while loop statement, while (counter < 10), where counter is an int variable. Which statement below is an equivalent way to write this while statement? while (10 < counter) while (9...
Suppose that the input is 0 5 6 4 9 8 -1.What is the output of the following code? int num = 0; int sum; cin >> sum; while (num != -1) { cin >> num; sum = sum + 2 * static_cast<int>(sqrt(num)); } cout << "Sum = " << sum << endl;
Please help me solve the following. Thank you in advance :) Answer the following five questions related to code output (Q2 i through m) What is the output of the following C+ coaer int numl; int num2; int *p = &num1 ; p = &num2 ; *p 25; num1 num2 + 6; p = &num! ; num2 = 73; *p = 47; cout << *p << " "<< numl <<""<< num2 << endl; What is the output of the following...
Question 1 (8 points): Choose the Correct Answer (2 points for each question) 1. What are the values of the variables x and y after executing the following code? intx=0,y-2; if (x0) y-13 else y-2;) c, x = 1,y=1 d.x-1,y 2 of the following will output Yes only if the integer variable numis either 2.3, 4, or 5? a. if ((2--num) II (nurn<-5)) {cout << "Yes" << endl; } miT b. İfQ2(num) & (num >-5)) {cout << "Yes"くくendl; } c....