Question

ue dates (Points 1) O 21 & Geany 14. What is the result of the following code? print(int(3+7)) (Points 1) O 37 O 10 37 10 15. What is the result of the following code? x-int(x)+4 print(float(x)) 0
0 0
Add a comment Improve this question Transcribed image text
Answer #1

14) 37

since we have given 3 and 7 in sigle quotes they will be treated as strngs so string concatenation will be doen rather than addition. So 37 will be printed.

15)54.0

Explanation:

x="5"#stores 5 as a string in x

x+="0"#concatenates 0 to x now x is 50

x=int(x)+4#now converts x to int adn adds 4 to it so it is 54

print(float(x))#prints 54.0 to console

Add a comment
Know the answer?
Add Answer to:
ue dates (Points 1) O 21 & Geany 14. What is the result of the following...
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
  • QUESTION 1 What will be displayed as a result of executing the following code? int   x...

    QUESTION 1 What will be displayed as a result of executing the following code? int   x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points    QUESTION 2 What will be the displayed when the following code...

  • Fix the code to print the result[] array properly: 1 #include <iostream> 2 3 using namespace...

    Fix the code to print the result[] array properly: 1 #include <iostream> 2 3 using namespace std; 4 5 void printArray(int array 7 for(inti= 0: i < 2;i++) cout くく array[i] << " ". 10 12 int mainO 13 14 int firstArray[2]10,20}; 16 int resultr21 17 int x; 18 19 II take input for second array 20 cin >>x 21 secondArray[0]-x; 22 secondarrayL1」-X+15 ; // Add elements 23 24 result0]- firstArray[0] + secondArray [0]; 25 result [1]- firstArray[1] + secondArray[1];...

  • 1,4,5 Multiple Choice (Find Output or Fix Error) 1. What will be the final value of...

    1,4,5 Multiple Choice (Find Output or Fix Error) 1. What will be the final value of product 7、 inta,b; Given above code, what will be the value of a andb if user types: 31 42 nt producr- 3, product 3 prodct while (product70) a) 81 31 What is the output of the following code? char Grade8 27 8. d) Error in do-while code 2. This loop is a good choice when you know how many times you want the loop...

  • What is the result of the following: print(input("Enter a number")* 2) if you entered 9. oooo...

    What is the result of the following: print(input("Enter a number")* 2) if you entered 9. oooo 13 Error What is the result of t = (1, 3.5): t.append(7) O (1,3,5,7) O (1,3,5) O (7) Error To check if there is a WIN in a tic-tac-toe game, the program has to check * O 6 lines of 3 boxes O 8 lines of 3 boxes O 9 boxes O The Center What is the result of print( int("3" + "5") +...

  • Question 17 (3 points) Predict the output of the following code segment: a = 99.98 if...

    Question 17 (3 points) Predict the output of the following code segment: a = 99.98 if a + 0.01 >= 100: print('A') elif a + 0.02 >= 100: print('B') print('c') else: print('D') print('E') Question 16 (3 points) Predict the output of the following code segment: X = 6 if x % 2 == 0: print ("x is even.") else: print ("x is odd.") Please use the decimal point to distinguish int and float. For example, number 3 + number 4...

  • in C language please! 9. 14 points Show what the following C code will print. const...

    in C language please! 9. 14 points Show what the following C code will print. const int MAX_I_COUNT = 4; const int MAX_J_COUNT = 15; int i, j; for( i = 1; i <MAX_I_COUNT; i++) { for(j = 2; j <MAX_J_COUNT; j += 4 ) printf("%d", j + i); puts("\n-----" ); puts( "I'm Done!" ); 10. 14 points What would be printed? int bean = 5, cheese = 3; int *p = &bean; *p += bean; ++cheese; *p += cheese;...

  • 9) 10 pts. What is the final result that will be stored in "a? double a...

    9) 10 pts. What is the final result that will be stored in "a? double a = 3. double b = 12. double c = 4 .; a 3. For 10 & 11 use the following function prototype: void Funl (int a, float c, double d); 10) 5 pts. Write the function call. Include the variable definitions. 11) 5 pts. Write the function header with an empty function body. 12) 5 pts The following code does NOT get a runtime...

  • What is the value of  result after the following code executes?   int a = 60; int b...

    What is the value of  result after the following code executes?   int a = 60; int b = 15; int result = 20; if (a = b) result *= 3; 30 20 60 10 code will not execute The numeric data types in C++ can be broken into two general categories which are integers and floating-point numbers singles and doubles real and unreal numbers numbers and characters numbers and literals Which line in the following program will cause a compiler error?...

  • What does the following program print? I // Exercise 3.12 Solution: ex03_12.cpp // What does this...

    What does the following program print? I // Exercise 3.12 Solution: ex03_12.cpp // What does this program print? #include <iostream> using namespace std; 3 4 7 int main() { int y; // declare y int x = 1; // initialize x int total = 0; // initialize total while ( 10 ) // loop 10 times y = X* X; // perform calculation cout << y << endl; // output result total += y; // add y to total ++x;...

  • Has to be in Unix! Lab 7 Programs 1. Create a prints.c file, and copy the...

    Has to be in Unix! Lab 7 Programs 1. Create a prints.c file, and copy the following into it: #include <stdio.h> int main(int argc, char * argv[]) { double x = 1.0, y = 5.1e7; float pi = 3.14159f; int i=0, j=5115; short int m= 6; unsigned long int n = 51151151; return 0; Now, write printf commands to: • print x with a field width of 6; print y with a field width of 8 and a precision of...

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