What will be printed for d by the following program segment? a=20; b=30; c=10; if (a>b && a>c) d=a; else if (b>a && b>c) d=b; else if (c>a && c > b) d=c; System.out.print(d);
What will be printed for d by the following program segment? a=20; b=30; c=10; if (a>b...
Question 33 Consider the following code segment. String letters - ("A", "B", "C", "D"), ("E", "P", "G", "1"), ("I", "J", "K", "L"}}; for (int col = 1; col < letters[0].length; col++) for (int row - 1; row < letters.length; row++) System.out.print(letterstrow][col] + " "); System.out.println(); What is printed as a result of executing this code segment? AET PJ DHL G J K L PJ GK
Thie What is the output of the following program segment? int count 1; do System.out.print(count (count-) + while(count++ <= 5);
Java 1. Can you explain it how it will be printed step by step? Thanks!! What is printed by the following? for (int i=1; i<4; i++) { for (char c=’a’; c<=’c’; c++) { if (i%2==0) { i++; System.out.println(i + " " + c); } else { c++; System.out.println(c + " " + i); } } } 2. Is there a compiler error in this code? If so, what is it? If not, what’s printed? Is there a compiler error in...
what will be printed? String s = "Donal J. Trump"; boolean b = ture; for (int i = 0; i < s.length(); i++){ if (b) { System.out.print(s.charAt(i)); } if (s.charAt(i) == ' ') { b = true; }else { b = false; }
20) What is the output of the following segment of C code: int avg(int n, int* a); int main () { int array[4]={1,0,6,9}; printf("%d", avg(4, array)+ 1); system("pause"); return 0; } int avg(int n, int* a) { int i, sum=0; for (i=0;i<n;i++) { sum+=a[i]; } return sum/n; } a) 16 b) 5 c) 4 d) 8 21) What is the output of the following segment of C code: int x = 2; int y = 3;...
What will the following program segment display? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1) { funny = 0; serious = 0; } else if (funny == 2) { funny = 10; serious = 10; } else { funny = 1; serious = 1; } cout << funny << serious << endl;
Multiple Choices (1 point each) to the program segment at the right is 85, what is its output? 1 If the input the scanf("%d", & s); a. if (s> 90) else if (s>-70) else if (s >= 80) else printf"Aln"); printf("Cn"); printf"BIn") printf"DIn") C. d. e. B, C 2. Assume a 12 and b 13, the if statement if(a<b) else printfl BIn") printf"A In" printf"Bin") a. displays A. b. displays A and B c. display B. d. causes a run-time...
What is the output of the following pseudo-code segment? A, B, C, or None of the above ** In pseudo-code, you ignore syntax errors and focus on the logic ** score = 60 if (score >= 70) print "C" else if (score >= 80) print "B" else if (score >= 90) print "A" and score = 105 if (score >= 90 && score <= 100) print "A" else if (score >= 80) print "B" else print "C"
18 C++ 1. What is the output of the following program segment? int y-22: while ((y 3) != 0) cout << y<< "": y=y-2; The output is 2. Suppose that the input is 100, 20,-8, 50, 20. What is the output of the following C++ code? int sum0 int num: int j cin >> num: if (num < 0) continue зит зит + num; cout<< sum << endl; The output is
What type of address is printed by following program Question 15 What type of address is printed by the following program: include <stdio.ho int maino int x; printf("Xp\n", & x); return ; Virtual Physical Dynamic Heap