praveenkumar450
Newbie level 5
- Joined
- Jul 2, 2014
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Location
- Hyderabad, Andhra Pradesh, India
- Activity points
- 55
I want to know why this program is executing output like this " -111 111 0" briefly .
Code:
#include <stdio.h>
#include <string.h>
int main() {
char string1[20];
char string2[20];
strcpy(string1, "Hello");
strcpy(string2, "Hellooo");
printf("Return Value is : %d\n", strcmp( string1, string2));
strcpy(string1, "Hellooooo");
strcpy(string2, "Hello");
printf("Return Value is : %d\n", strcmp( string1, string2));
strcpy(string1, "Hellooo");
strcpy(string2, "Hellooo");
printf("Return Value is : %d\n", strcmp( string1, string2));
return 0;
}