Aspire Faculty ID #17685 · Topic: JECA MCA 2025 · Just now
JECA MCA 2025

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.

Previous 10 Questions — JECA MCA 2025

Nearest first

Next 10 Questions — JECA MCA 2025

Ascending by ID
Ask Your Question or Put Your Review.

loading...