Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program ? #include<stdio.h> int main() { char t; char p1 = "India", p2; p2=p1; p1 = "BIX"; printf("%s %s\n", p1, p2); return 0; } ?->(Show Answer!)
1. What will be the output of the program ? #include<stdio.h> int main() { char t; char p1 = "India", p2; p2=p1; p1 = "BIX"; printf("%s %s\n", p1, p2); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
Step 1: char *p1 = "India", *p2; The variable p1 and p2 is declared as an pointer to a character value and p1 is assigned with a value "India". Step 2: p2=p1; The value of p1 is assigned to variable p2. So p2 contains "India". Step 3: p1 = "BIX"; The p1 is assigned with a string "BIX" Step 4: printf("%s %s\n", p1, p2); It prints the value of p1 and p2. Hence the output of the program is "BIX India".