+ 2
What is the output of this code?
#include <stdio.h> #include <string.h> int main() { char a[] = {'h','e','l','l','o','\0'}; char b[] = "world"; if(strlen(a) == strlen(b)){ printf("%s", strupr(a)); } else { printf("%s", b); } return 0; }
1 Answer
+ 3
HELLO
Because the length of a is equal to the length of b, the program prints the strupr (uppercase) of a, which is HELLO.