Answer:
The answer to this question is given below in the explanation section.
Explanation:
In this question, the given code is :
<em>def divide(numA,numB):</em>
<em> quotient = numA/numB</em>
<em> return quotient</em>
<em>#the main part of your program that calls the function</em>
<em>numC=40</em>
<em>numD=5</em>
<em>answer=divide(numC,numD)</em>
<em>print("Quotient", answer)</em>
<em>print (numA) </em>
The variable numA scope is local to divide function.
Because you can not access this variable outside of the divide function. All other variables such as numB and quotient also local variables of the divide function. These variables can not be accessible outside the divide function.
Doesn't look like there are any..
Answer:
1. Buffer could be overflowed when input entered by user in command line is greater than size 12 it may of size 13 or larger.
for example: when user enters the string 'dolatsinghsodha' than the size of that string stored in bar variable will be 15 as it not size bounded but when it stored in MyArray[12] than it will overflow the buffer for array because MyArray[] is input bounded to maximum 12 characters.
2. There are two ways to prevent buffer overflow
i) make bar varaible input bounded to 12 characters or
ii) assign MyArray[] size at dynamic time
or change code to following state:
void simple (char *bar) {
int a=bar.length
char MyArray[a];
strcpy(MyArray, bar); // copies bar in MyArray --> Myarray==bar }
}
but it in not possible in some languages and platforms
or we can ask user
Want to avoid giant mushrooms than stay away from dark oak and mooshroom biomes
Answer:
umm the first one I think..? lol