Answer:-
Plz give thumbs up.Thank u
C) 34
First,for loop takes n=3 ,checks the conditon (3<=4) it is true so the body of loop is executed. function prints the value 3.After it increment the value of n and It takes n=4, (4<=4) true,loop is executed and prints value 4.if n=5, (5<=4) conditon in false ,So the body of loop doesn't execute.
10) What is the output when the following code fragment is executed? void exam(int i) {cout...
11) What is the output of the following Che statements? void Exam(int N) { int list1[3] { 2, 4, 6); if (NX2 - 0) cout << listi[N - 1); else cout << listi[N 5):) void main() { int list[3] - (1, 3, 5); Exam(list[2]);} A) 2 B) 4 C) 6 D) 3 12
2. Write a MIPS program that translates the following C code int a 1234; b 5678 int sum void main () atb sum = cout <<sum; }
2. Write a MIPS program that translates the following C code int a 1234; b 5678 int sum void main () atb sum = cout
1)What is the output of the following code: int i = 10; do { cout << i; i++; } while (i < 5); cout << "-done"; 2)What is the output of the following code (note there are no endl's, all output is on single line)? for (int i = 1; i <= 3; i++) { cout << '('; for (int j = 0; j < (i*2); j++) cout << 'x'; cout << ')'; }
11. What is the output of the following program fragment? int v[5] = {10, 20, 30, 40, 50}; for (int i=3; i>0; i--) { cout << v[i] << " "; } A. 102030 B. 302010 C. 403020 D. 40302010 12. Given the following code: char a[20]; char b[30]; Copy(a, b); // Copy all elements of b into a What is the best signature (header) of the Copy function? A. void Copy(char x[], char y[]) B. void Copy(const char x[], char...
What is the output, to the console, once the following code has executed? int collatz(int value) { if(value % 2 ==0) return value /2; else return value * 3+1; } int main() { int currentValue=1; int i; for (i=0; i<5; i++) { printf("%d\n", currentValue); currentValue= collatz(currentValue); } return 0; }
10. What prints when the following code is executed? public static void main (String args) "Cattywampus"; for (int i-s.length )-1 i> 0 i-2) if (s.charAt (i)a') System.out.print(""); ] else if (s.charAt (i)'t') System.out.print (s.charAt (i-2)) i+ti else System. out. print (s . charAt (İ) ) ; if (i<2) System.out.print ("y"); System.out.println ()
10. What prints when the following code is executed? public static void main (String args) "Cattywampus"; for (int i-s.length )-1 i> 0 i-2) if (s.charAt (i)a') System.out.print(""); ]...
What is printed when the following code is executed? #include <stdio.h> int main() { for (int i=3, j=5; i>=0; i-=2, j+=j*i) { printf("%d", j); منم }
31. The following code segment is syntactically correct: int number{20}; cout << number << setbase(16) << " " << number << setbase(10) << " " << number << showpos << " " << number << endl; T__ F__ 32. The following statement wants to determine if ‘count’ is outside the range of 0 through 100: if (count < 0 && count > 100) T__ F__ 33. There is...
What is the output of the following code fragment? int i = 1; while( i <= 5 ) if(i == 2 || i == 4) System.out.println(i + ":" + " is an even index) System.out.println("i: " + i); i++;
2. What is the value of x alter the following code is executed # include<iostream> using namespace std; int main int t-0, c- 0,x-3; while (c < 4) t=t+x; cout << x return 0; a) 3 b) 21 c) 24 d) 48 3. What is the output of the following code? # include<iostream> using namespace std; int main0 int a- 3; for (int i 5; i >0; i) a a+i cout << a << “ “ return 0; d) 8...