Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



What will be the output of the following program? 
#include int main() 
{ 
char str1[20] = "Hello "; 
char str2[20] = "Hello"; 
strcpy(str2, str1); 
if (strcmp(str1, str2) == 0) 
printf("Equal "); 
else 
printf("Not Equal "); 
return 0; 
}





Solution

After strcpy, both strings are same → strcmp returns 0 → Equal.


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...