Computer Science, asked by Kristen5460, 5 hours ago

#include void main()
{
int x = 0;
int *ptr = &5;
printf("%p\n", ptr);
}

Answers

Answered by swapnaammu2020
0

Answer:

compile time error

check the program it has some errors

Answered by ankhidassarma9
0

Answer:

#include void main()

{

int x = 0;

int *ptr = &5;

printf("%p\n", ptr);

}

  • The execution of this code will raise the following error :

          error: #include expects "FILENAME"

  • Once we rectify this error and re-write the given codes like :

      #include <stdio.h>

          void main()

            {

           int x = 0;

            int *ptr = &5;

            printf("%p\n", ptr);

            }

  • we will get the following error once we will attempt the execution:

       error: lvalue required as unary ‘&’ operand

 

Explanation:  

  • #include is a way to include a standard or user-defined file in the program and is mostly written at the beginning of any C program. This directive is read by the preprocessor which then inserts the content of a user-defined or system header file into the following program.
  • address of (&) operator can be applied to a variable and not a literal.   The address-operator & requires a variable from which to get the address. int *ptr = &5;  will generate  Compile time error.

For Similar kind of question, click here ->

https://brainly.in/question/29221420

https://brainly.in/question/16426979

Similar questions