现在,我们将看到该计划的实际执行情况 -
#include <stdio.h> int main() { char s1[] = "TajMahal"; int i = 0; while(s1[i] != '\0') { i++; } printf("Length of string '%s' is %d", s1, i); return 0; }
该计划的输出应为 -
Length of string 'TajMahal' is 8