Code a contains a set of eight lines


Asked by admin @ in English viewed by 31506 People


Choose the correct option.

Code A contains a set of eight lines that occur ten times in different points of the program. This code ispassed to a programmer who puts the set of eight lines in a function definition and calls them at theten points in the program. Assume this new code to be Code B. Which code will run faster using aninterpreter?​

Answered by admin @


Answer:

Que: Choose the correct answer

In a sequential programming language, code statements are executed in which order?

Option 1 : All are executed simultaneously

Option 2 : From top to bottom

Option 3 : From bottom to top

Option 4 : None of these

Ams-2

Que: Choose the correct answer

The construct “if (condition) then A else B” is for which of the following purposes?

Option 1 : Decision-Making

Option 2 : Iteration

Option 3 : Recursion

Option 4 : Object Oriented Programming

Ans-1

Que: Choose the correct answer

What does this function compute for positive n?

function f(int n)

{

if (n equals 1)

{ return 1 }

else

{ return f(n-1)/f(n-1) + n }

}

Option 1 : 1 + n

Option 2 : 1 + 2 + 3 + … + n

Option 3 : 1 + n, if n > 1, 1 otherwise

Option 4 : None of the above

Ans-3

Que: Choose the correct answer

int area(double radius)

{

return PI*radius*radius;

}

Que: Which of the following is always true about the function area?

Option 1 : It returns the area of a circle within the limits of double precision.

Option 2 : It returns the area of a circle within the limits of the constant PI.

Option 3 : It returns the area of a circle within the limits of precision of double, or the constant PI, whichever is lower.

Option 4 : None of the above.

Ans-1

Que: Choose the correct answer

Assuming n > 2, What value does the following function compute for odd n?

function f (int n)

{

if (n equals 1) { return 1 }

if (n equals 2) { return f(n-1) + n/2 }

return f(n-2) + n;

}

Option 1 : 1 + 2 + 3 + 4 + … + n

Option 2 : 1 + 3 + 5 + 7 + … + n

Option 3 : n/2 + (1 + 3 + 5 + 7 + … + n)

Option 4 : 1 + (1 + 3 + 5 + 7 + … + n)

Ans-2

Que: Choose the correct answer

function g(int n)

{

if (n > 0) return 1;

else return -1;

}

function f(int a, int b)

{

if (a > b) return g(b-a);

if (a < b) return g(a-b);

return 0;

}

If f(a,b) is called, what is returned?

Answered by boggarapu @


2

Answered by boggarapu @


2

Answered by deva0735 @


B

Do you know the better answer?

Similar Questions

Which nucleic acid contains the coded instructions for making proteins

Asked by admin @ in Biology viewed by 147 persons

Which cell organelle contains coded directions for production of proteins? Question 3 options: endoplasmic reticulum lysosome Golgi apparatus nucleus

Line cd contains points a (4, −7) and b (4, 8). the slope of line cd is

Asked by maham237 @ in Mathematics viewed by 195 persons

Line ab contains points a (8, −4) and b (1, −5). the slope of line ab is

Asked by maham237 @ in Mathematics viewed by 168 persons

Line ab contains points a (0, 1) and b (1, 5). the slope of line ab is

Asked by maham237 @ in Mathematics viewed by 155 persons

Line AB contains points A (0, 1) and B (1, 5). The slope of line AB is −4 negative 1 over 4 1 over 4 4 I'm thinking it's D. …

You use a line of best fit for a set of data

Asked by maham237 @ in Mathematics viewed by 116 persons

You use a line best fit for a set of data to make a prediction about an unknown value. The correlation coefficient for your data set is -0.015. How confident …

A line contains points m(1, 3) and n(5, 0). what is the slope of mn?

Asked by maham237 @ in Mathematics viewed by 216 persons

Line ab contains points a(4, 5) and b(9, 7). what is the slope of ?

Asked by maham237 @ in Mathematics viewed by 162 persons

Line ab contains points a (3, −2) and b (1, 8). the slope of line ab is

Asked by maham237 @ in Mathematics viewed by 157 persons

Line qr contains (2, 8) and (3, 10) line st contains points (0, 6) and (−2, 2). lines qr and st are

Asked by maham237 @ in Mathematics viewed by 156 persons

Line QR contains (2, 8) and (3, 10) Line ST contains points (0, 6) and (-2, 2). Lines QR and ST are (4 points) Select one: a. parallel because the …

How many iambs per line does a shakespearean sonnet contain?

Asked by jaiden98 @ in English viewed by 100 persons

How to use a set square to draw perpendicular lines

Asked by admin @ in Mathematics viewed by 98 persons

With a line 7 cm long. Use a set square and a ruler and draw perpendicular lines at both ends

How many iambs per line does a shakespearean sonnet contain

Asked by admin @ in English viewed by 120 persons

How many iambs per line does a Shakespearean sonnet contain? two iambs three iambs four iambs five iambs

Which contains the character's lines and dialogue for a video

Asked by maham237 @ in English viewed by 138 persons

a location list a storyboard a shooting script a shooting schedule

Find the slope of the line containing the given points

Asked by admin @ in Mathematics viewed by 103 persons

Find the slope of the line that contains the following pairs of points (2,4) (0,8)

A fixed verse poem contains lines that are in length

Asked by maham237 @ in English viewed by 148 persons

Most viewed questions in English


There are ways to spice up one's work amcat

Asked by admin @ in English viewed by 77045 persons


Suxushi pvt company is looking for a laptop passage

Asked by admin @ in English viewed by 31618 persons


Code a contains a set of eight lines

Asked by admin @ in English viewed by 31506 persons


The orchestra has one whistler who plays instruments well

Asked by admin @ in English viewed by 16106 persons


Collins english grammar and composition class 6 answer key

Asked by admin @ in English viewed by 13337 persons



New learner's english grammar and composition class 8 solutions pdf

Asked by admin @ in English viewed by 13250 persons


Reeta and rishika are of the same height

Asked by admin @ in English viewed by 12424 persons


The picture of an ant when enlarged 200 times

Asked by admin @ in English viewed by 12412 persons


New grammar with a smile class 8 solutions pdf

Asked by admin @ in English viewed by 12341 persons


New grammar plus class 6 solutions by ratna sagar

Asked by admin @ in English viewed by 12190 persons



Total english morning star class 9 icse solutions

Asked by admin @ in English viewed by 10123 persons


Oxford new pathways english book for class 7 solutions

Asked by admin @ in English viewed by 9610 persons


Oxford new learner's grammar and composition class 6 solutions

Asked by admin @ in English viewed by 9511 persons


Essentials of english grammar and composition class 7 solutions

Asked by admin @ in English viewed by 9349 persons


The meeting is in conference room a at 10 am

Asked by admin @ in English viewed by 9279 persons