main ()
{
char a[]="HPES";
char *p="RCPL";
a="RCPL";
p="HPES";
printf("\n %s %s", a,p);
}
12:53 PM
Answers
Answered by
0
Answer:
I having technical issue so sir I am leaving please take my attendance sir
Answered by
0
Answer: The output of the code is explained below. Output is based on C language.
String: The string data type is provided by the C libraries, and it is often considered to be among the most useful of these kinds. A sequence of letters or other characters can be stored in a variable known as a string. For example, "Hello" or "May 10th is my birthday!" are both strings. To generate a string, we must first declare it, and only after that can we save a value in it like we do with the other data types.
Explanation:
- First of there is an error inside Main, in the third line of the code
- a = "RCPL"
- since a[] is a string, therefore a will point to first element of string
- "a" will not become an array, it is a pointer pointing to first element of our string HPES and the value it holds is "H"
- if we ignore third line then code will get executed.
- the output will be HPES HPES
#SPJ2
Similar questions