Ask 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. 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);

+4
Answers (1)
  1. 10 June, 16:50
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers