+ 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; }

27th Jan 2019, 6:31 PM
Mihai C
Mihai C - avatar
1 Respuesta
+ 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.
27th Jan 2019, 8:10 PM
Rowsej
Rowsej - avatar