Ask Question
11 August, 05:52

Which of the following code segments does not contain any errors?

Select one:

a. void printnum (int x) { print ("%i", x); return x; }

b. int cube (int s) { int s; return (s s s); }

c. double triple (float n) { return (3 * n); }

d. double circumference (int r) return (3.14 2 r);

+5
Answers (1)
  1. 11 August, 07:21
    0
    c. double triple (float n) { return (3 * n); }

    Explanation:

    In option a print is used to print integer. While printf is used in C to print something.

    In option b there is no * operator between s s s it should be s*s*s. So it will give error.

    In option d there is also no multiply operator * in between 3.14 2 r it should be 3.14*2*r.

    So we can say that option c is error free.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following code segments does not contain any errors? Select one: a. void printnum (int x) { print ("%i", x); return x; } b. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers