- 465 views
What is the Output ?
Answer : NULL…
- 1 minute read
- No comments
What is the Output ?
main ()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
Answer : NULL
- We are incrementing the pointers p1,p2.
- When it reached the end of the string, *p2 points to NULL.
- We have lost the address of the starting position.
Related Tags
- Accentur interview questions and answers,
- Applied Materials interview questions and answers,
- Asian Paints Ltd. interview questions and answers,
- basic c programs,
- basics of c,
- Bosch India Software interview questions and answers,
- c c++ programs for interview,
- c code,
- c coding questions,
- c interview questions,
- c language,
- c programming,
- c programming basics,
- c programming coding questions,
- c programming examples,
- c programming language,
- c programming test questions,
- c programming tricky questions,
- c programming tutorial,
- c programs with solutions,
- c_language,
- Capgemini interview questions and answers,
- CASTING NETWORKS INDIA PVT LIMITED interview questions and answers,
- CGI Group Inc interview questions and answers,
- Chetu interview questions and answers,
- Ciena Corporation interview questions and answers,
- Collabera Technologies interview questions and answers,
- computer programming,
- cracking the coding interview,
- Dell International Services India Pvt Ltd interview questions and answers,
- DHFL Pramerica Life Insurance Company Ltd interview questions and answers,
- Elico HealthCare Services Ltd interview questions and answers,
- examples of output devices,
- factorial program in c,
- Flipkart interview questions and answers,
- HCL Technol interview questions and answers,
- IBM interview questions and answers,
- Indecomm Global Services interview questions and answers,
- interview questions and answers,
- learn c programming,
- Mavenir interview questions and answers,
- Mphasis interview questions and answers,
- NetApp interview questions and answers,
- Oracle Corporation interview questions and answers,
- output definition computer,
- output devices of computer and their functions,
- pattern programs asked in interview,
- PeopleStrong interview questions and answers,
- pointers in c,
- programs asked in interview in java,
- R Systems interview questions and answers,
- Raqmiyat Information Technologies Pvt Ltd interview questions and answers,
- Reliance Industries Ltd interview questions and answers,
- SAP Labs India Pvt Ltd interview questions and answers,
- strings in c,
- Tata AIA Life Insurance interview questions and answers,
- Tech Mahindr interview questions and answers,
- the c programming language,
- The Linde Group interview questions and answers,
- what is output in computer,
- zycus infotech interview questions and answers