Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
m1)Int a=0.b=20;for (int i=20;i>=4;i=i-3){if(i%21=0a=a+2;)b=b+a:
Home
Education
m1)Int a=0.b=20;for (int...
asked
Nov 27, 2021
in
Education
by
JackTerrance
m 1) Int a=0.b=20; for (int i=20;i>=4;i=i-3) { if(i%21=0 a=a+2; ) b=b+a: predict the value of b after execution Select the correct answer from above options
computer-science-interview-questions
computer-science-questions
1
Answer
0
votes
answered
Nov 27, 2021
by
JackTerrance
Best answer
Answer: a= 0, b = b + 0 = 20 + 0 = 20 Explanation: loop start from 20 which smaller than 21 so that’s why condition is always false. No change in the value of a….
Related questions
0
votes
Q: Int a=0.b=20:for (int i=20:i>=4:i=i-3){if(i%2!=0)a=a+2:3b=b+a:
Int a=0.b=20: for (int i=20:i>=4:i=i-3) { if(i%2!=0) a=a+2: 3 b=b+a: . Select the correct answer from above options...
asked
Nov 27, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: int fun(int n){if(n!=0) {return n – fun(n-5);}else {return n;}}int main(){int n = 20, z;z = fun(n);printf(“%d”, z);
int fun(int n) { if(n!=0) { return n – fun(n-5); } else { return n; } } int main(){ int n = 20, z; z = fun(n); printf(“%d”, z); } Select the correct answer from above options...
asked
Dec 31, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Analyse the given program segment and answer the following questionsi) write the output of the program segment ii)how many times does the body of the loop gets executefor(int m=5 ; m<=20 ;m+=5){if (m%3= = 0)break;elseif (m%5= = 0) System.out.println(m) continue;}
Analyse the given program segment and answer the following questions i) write the output of the program segment ii)how many times ... body of the loop gets execute for(int m=5 ; m...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: {int ar[] = { 3, 1, 4, 6, 5 };int ar_size = sizeof(ar) / sizeof(ar[0]);isTriplet(ar, ar_size) ? cout << “Yes” : cout << “No”;return 0;
{ int ar[] = { 3, 1, 4, 6, 5 }; int ar_size = sizeof(ar) / sizeof(ar[0]); isTriplet(ar, ar_size) ? cout...
asked
Dec 9, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: {int ar[] = { 3, 1, 4, 6, 5 };int ar_size = sizeof(ar) / sizeof(ar[0]);isTriplet(ar, ar_size) ? cout << “Yes” : cout << “No”;return 0;
{ int ar[] = { 3, 1, 4, 6, 5 }; int ar_size = sizeof(ar) / sizeof(ar[0]); isTriplet(ar, ar_size) ? cout...
asked
Dec 3, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: /determiningstatic void sortint al){ int x = a.length;int m.p:for(int i=0; i<x-1; i++)( m alu:pofor(int j=i+1; }<x;j++){ if(alm)llassume ali i
/determining static void sortint al) { int x = a.length; int m.p: for(int i=0; i...
asked
Dec 25, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: b. Write a java statement to accomplish each of the following tasks:i. Declare a variable, sum and a to be of type int.ii. Assign 1 to variable a.iii. Assign 0 to variable sum.iv. Add variable a to variable sum and assign the result to variable sum.
b. Write a java statement to accomplish each of the following tasks: i. Declare a variable, sum and a to be ... value of variable sum. Select the correct answer from above options...
asked
Nov 27, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Q.32 :-What will the SWAP macro in the following program beexpanded to on preprocessing? will the code compile?#include<stdio.h>#define SWAP(a, b, c)(ct; t=a, a=b, b=t)int maino{intx=10, y=20;SWAP(x, y, int);printf(“%d %d\n”, x, y);
Q.32 :-What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile? ... y); return 0; Select the correct answer from above options...
asked
Nov 30, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: int find(int i) {if(>1)j=find(j/10)+(j%10)elsej=0;return j;void main()int i=1000int kk=find(i):
int find(int i) { if(>1) j=find(j/10)+(j%10) else j=0; return j; void main() int i=1000 int k k=find(i): printf(“%d”, K) Select the correct answer from above options...
asked
Dec 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: int find(int j) {if(>1Xj=find(j/ 10)+(%10);}else {j=0;return j;void main()int i=1000,int k;k=find(i);
int find(int j) { if(>1X j=find(j/ 10)+(%10); } else { j=0; return j; void main() int i=1000, int k; k=find(i); printf(“%d”, k); Select the correct answer from above options...
asked
Dec 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: What will be the output of the program? #include #include void fun(char *msg, …); int main() { fun(“indiabix”, 1, 4, 7, 11, 0); return 0; } void fun(char *msg, …) { va_list ptr; int num; va_start(ptr, msg); num = va_arg(ptr, int); num = va_arg(ptr, int); printf(“%d”, num); } indiabix 1 7 11 0 1 4 7?
What will be the output of the program? #include #include void fun(char *msg, ); int main() { fun( indiabix , 1, 4, ... 7 11 0 1 4 7? Select the correct answer from above options...
asked
Nov 30, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Cell A1 contain the number 20 and B1 contain 3. What will be the content of cell C1, if the formula = A1 + B1 * 2^3 is entered in cell C1?
Cell A1 contain the number 20 and B1 contain 3. What will be the content of cell C1, if the formula = A1 + ... is entered in cell C1? Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: A random variable X has the following probability distribution : `{:(X:,1,2,3,4,5,6,7,8),(P(X):,0.15,0.23,0.12,0.10,0.20,0.08,0.07,0.08):}` for the ev
A random variable X has the following probability distribution : X: 1 2 3 4 5 6 7 8 P(X): 0.15 0.23 0.12 0.10 0.20 0.08 0.07 0.08 for the events E=[X is a prime number] F={X...
asked
Nov 16, 2021
in
Education
by
JackTerrance
probability-interview-questions
probability-interview-questions-answers
probability-multiple-choice-questions
probability-mcq-with-answers
probability-mcq
probability-questions
0
votes
Q: >>> list(range(0, -9,-1)) will print[-1, -2, -3, -4,-5, -6, -7, -8)[0,-1, -2, -3, -4,-5, -6, -7, -8][0,-1, -2, -3, -4, -5, -6, -7, -8,-9)
>>> list(range(0, -9,-1)) will print [-1, -2, -3, -4,-5, -6, -7, -8) [0,-1, -2, -3, -4,-5, -6, -7, -8 ... [0,-1, -2, -3, -4,-5, -6, -7] Select the correct answer from above options...
asked
Dec 28, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Plz write a program for the following pattern in Java class 10 ICSE2 6 12 20 30 424 6 8 10 122 2 2 20 0 0000
Plz write a program for the following pattern in Java class 10 ICSE 2 6 12 20 30 42 4 6 8 10 12 2 2 2 ... spam. Answer only if you know Select the correct answer from above options...
asked
Nov 30, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
...