#include<stdio.h> int main() { char t; char *p1 = "India", *p2; p2=p1; p1 = "CURIOUSTAB"; printf("%s %s\n", p1, p2); return 0; }
Step 2: p2=p1; The value of p1 is assigned to variable p2. So p2 contains "India".
Step 3: p1 = "CURIOUSTAB"; The p1 is assigned with a string "CURIOUSTAB"
Step 4: printf("%s %s\n", p1, p2); It prints the value of p1 and p2.
Hence the output of the program is "CURIOUSTAB India".
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.