← Back to Question List
C Code Walkthrough #10
String Traversal with Null Terminator
📄 Code
Read carefully — what does this print?1#include <stdio.h>23int main() {4 char str[] = "Hello";5 int count = 0;6 int i = 0;7 while (str[i] != '\0') {8 count++;9 i++;10 }11 printf("%d\n", count);12 return 0;13}