D. Reply.
<u><em>Brainiest PLEASE!
</em></u>
I want to start playing!! it seems super cool, don’t know much ab it but i like paimon lol
Answer:
// function with memory leak
void func_to_show_mem_leak() {
int *pointer;
pointer = malloc(10 * sizeof(int));
*(pointer+3) = 99;}
// driver code
int main()
{
// Call the function
// to get the memory leak
func_to_show_mem_leak();
return 0; }
Explanation:
Memory leakage occurs when programmers allocates memory by using new keyword and forgets to deallocate the memory by using delete() function or delete[] operator. One of the most memory leakage occurs by using wrong delete operator.
The delete operator should be used to free a single allocated memory space, whereas the delete [] operator should be used to free an array of data values.
Answer:
The answer to this question is "nested".
Explanation:
The answer to this question is nested because, In programming languages, there is a concept of nested if-else statement. In nested if-else statement placing if statement inside another IF Statement that is known as nested If in C Programming.
Example of nested if can be given as
#include <stdio.h>
int main()
{
int a,b,c;
printf("Enter 3 number\n");
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
if(a>b)
{
if(a>c)
{
printf("A is greater: %d",a);
}
}
else
{
if(b>c)
{
printf("B is greater: %d",b);
}
else
{
printf("C is greater: %d",c);
}
}
return 0;
}
output:
Enter 3 number
4
7
9
c is greater: 9