Computer Science, asked by priyapj9953, 8 months ago

Function MyDisplay(string MyStr) //statement 1 { print ""Hello !"" print MyStr return 1 // statement 2 } function main() //statement 3 { string str= ""Mickey"" MyDisplay(str) // statement 4 } Which statement will generate an error.

Answers

Answered by harwinderb678
6

Explanation:

1. What is the difference between a function and a method?

a. Function is a named code unlike method which is a part of an object

b. Function contained in an object is called a method

c. Function cannot change variables outside its scope unlike method

d. There is no difference between the two

Answer : a

Answered by Jasleen0599
0

Statement 1 generate an error.

Function MyDisplay(string MyStr) //statement 1

{ print ""Hello !"" print MyStr return 1 // statement 2 } function main() //statement 3 { string str= ""Mickey"" MyDisplay(str) // statement 4 }

  • Simply said, a function is a "chunk" of code that you may reuse repeatedly rather than having to write it out several times. Programmers can divide an issue into smaller, more manageable parts, each of which can carry out a specific task, using functions.
  • A pointer to the textual representation of the current errno value is returned by the strerror() method.
  • Errors are the variation between the actual measurement and what was really measured. By writing our measurement with an uncertainty, we demonstrate our inaccuracy. Systematic, random, and human error are the three different categories of errors.

#SPJ2

Similar questions