Question

What will be the O/P of these codes: int a 15 int b- 4: ntcO,d-0,c-0 c-a%b; e a+b+c+d: System.out.printin a+a nbbnd-de System.out printin Ca _ + a +.b-.. +b+,c--+e+, d-“ +d +,e-+ek /Line(1) thru Line(5) /Line(6) ANS: Line I) Line(2) Line(3) Line(4) Line(5),
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output

1 a -15 с 3 5 e-25 6 a15, b -4, c-3, d-3, e-25

Explanation

c = a % b; // remainder of 15 / 4

d = a / b; // Quotient of 15 / 4

e = a + b + c + d; // sum of a b c and d

Add a comment
Know the answer?
Add Answer to:
What will be the O/P of these codes: int a 15 int b- 4: ntcO,d-0,c-0 c-a%b;...
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
  • y-y+2 ; eise iflxc4) Output: else System.out.printin(y) 8. int x-5, y-3 if (xs 10) x x-2...

    y-y+2 ; eise iflxc4) Output: else System.out.printin(y) 8. int x-5, y-3 if (xs 10) x x-2 else x-x+2; Output: System.out printin(y): 9. int x -8; while (x 0) system, out .printin ("ні") ; output: - 10. int x 5 do ) while (x > 23) System.out println(x): output: 11. int x 25, y 8 System.out.println (x+ y) 12. int [1 arrayi 12, 4, 6, 8, 10) int value 0; for (int a 0; a array1.1ength; a++) Output value + arrayl...

  • Which of the following are valid array declarations? a. int[] array- new int[10]; b. double [array...

    Which of the following are valid array declarations? a. int[] array- new int[10]; b. double [array double[10]; c. charl charArray "Computer Science"; None of the above Analyze the following code: class Test public static void main(Stringl] args) System.out.println(xMethod(10); public static int xMethod(int n) System.out.println("int"); return n; public static long xMethod(long n) System.out.,println("long"); return n The program displays int followed by 10 The program displays long followed by 10. The program does not compile. None of the above. tions 3-4 are...

  • 1. What is the output? System.out.print(3 + 3 * 3); a. 18 b. 12 c. 9 d. 0 e. 10             2.   What is output by the code below? System.out.print("\\dog\\cat&#...

    1. What is the output? System.out.print(3 + 3 * 3); a. 18 b. 12 c. 9 d. 0 e. 10             2.   What is output by the code below? System.out.print("\\dog\\cat"); a. dog b. dogcat c. \\dog\\cat d. \dog\cat e. catdog\\\\             3.   What is returned by the call     getIt(9) ? public static int getIt(int num){ int ans = 0; if( num >=2 ) {      if( num >= 7)         ans += 2;      else         ans += 3; } ans += 4; return ans; }...

  • #include<stdio.h> int f(int a,int b); int main(){ int a=8, b=4,c=2; b = f(c,a); printf("a=%d,b=%d\n,a,b,c); c =...

    #include<stdio.h> int f(int a,int b); int main(){ int a=8, b=4,c=2; b = f(c,a); printf("a=%d,b=%d\n,a,b,c); c = f(a+3,b-2); printf("a=%d,b=%d,c=%d\n",a,b,c); return 0; } int f(int a, int b){ a=b+6 b=a-2 printf("a=%d,b=%d\n",a,b); return a+b; } what is the first line of output produced? what is the second line of output? what is the third line if output? what is the forth line of output? if there is problems ill post the choices thank you

  • E) [Ar]3d04s44p 2) How many lone pairs of electrons are on the O atom in OF2? A) 0 B) 1 C) 2 D) 3 3) Which atom in...

    E) [Ar]3d04s44p 2) How many lone pairs of electrons are on the O atom in OF2? A) 0 B) 1 C) 2 D) 3 3) Which atom in each group (I and II) has the smallest atomic radius? (I) Ca, Ti, Br (II) O, S, Se A) Ca; Se B) Br; Se C) Br; O D) Ca; O 4) How many valence electrons are there in a Bi atom? A) 2 B) 3 C) 4 D) 5 E) 6 5)...

  • For precious question, what O/P is produced (do not show the price list), if the user...

    For precious question, what O/P is produced (do not show the price list), if the user enters 7 for the input request: "Enter seat code:" What O/P si produced by the following code? int v1 = 15; int v2 = 7; double sum = v1 + v2; int r = v1 % v2; int larger; if (v1 > v2) larger = v1; else larger = v2; System.out.print ("the larger value is:" + larger + sum + remainder of v1/v2 =...

  • QUESTION 9 What will be the output of following code snippet? int a[3] = {1, 2,...

    QUESTION 9 What will be the output of following code snippet? int a[3] = {1, 2, 3};         int *p = a;         int **r = &p;         printf("%p %p", *r, a); A. Different memory addresses printed B. 1 2 C. Same memory address printed twice D. 1 1 2 points    QUESTION 10 What will be the output of following code snippet? int arr[4] = {1, 2, 3, 4};         int *p;         p = arr + 3;         *p = 5;         printf("%d\n", arr[3]); A....

  • a) int a -5, b 6, c 7 System.out.printin(a--b-- System.out.printin(a---a- System.out.println (a+++b+++c) Output from part a)...

    a) int a -5, b 6, c 7 System.out.printin(a--b-- System.out.printin(a---a- System.out.println (a+++b+++c) Output from part a) int vl-10, v2 -20 if (viV2 30 11 v2+21) Output from part b) System.out.printin("1."+vi+""2) System.out.println("2. " +vl+"+ v2) System.out.printin("3."+vl+"v2)L else if (v2-20 && ++v1 11)( elset Output from part c) int x - 10, y - 20 System.out.println (x) System.out.println(y)

  • Could you please do these questions using C and provide the codes and outputs for all...

    Could you please do these questions using C and provide the codes and outputs for all question? Thank you! ° Chapter 17-page 454 Exercise #5 has a question-code the problem and run it to determine the answer - Take a screenshot of the code and the answer Suppose that f and p are declared as follows: struct 5. union char a, b; int c int e (5] Which of the following statcments are legal? (b) p->e(310; (d) p->d->c20; o Chapter...

  • With a Scanner object created as follows, what method do you use to read an int...

    With a Scanner object created as follows, what method do you use to read an int value? Scanner input = new Scanner(System.in); A. input.int(); B. input.nextInt(); C. input.integer(); D. input.nextInteger(); What is the output of the following code? x = 0; if (x > 0) System.out.println("x is greater than 0"); else if (x < 0) System.out.println("x is less than 0"); else System.out.println("x equals 0"); A. x is greater than 0 B. x is less than 0 C. x equals 0...

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