Computer Science, asked by eee203025, 6 months ago

#include <stdio.h>
int main() {
char *p = "Phone";
p++;
char c = (*p);
++c;
p--;
printf("%c%s", c, p++);
}​

Answers

Answered by nanananana70
16

Answer:

thanks youuuuuuu for free points

Answered by pruthaasl
0

Answer:

The output of the given code is iPhone.

Explanation:

  • The first line of the code declares a pointer variable p of character data type and is initialized to "Phone".
  • In the next line of the code, the value of variable p is incremented.
  • Another variable c of character data type is declared and initialized the contents of pointer variable p.
  • The contents of variable c are incremented and the contents of variable p are decremented.
  • In the print statement, two format specifiers are used, i.e., %c and %s
  • The %c format specifier is used to print characters.
  • The %s format specifier is used to print strings.
  • On the execution of the print statement, the contents of c and p are printed and then the value of p is incremented.

Therefore, the successful execution of the code gives the output as iPhone.

#SPJ3

Similar questions