Vidyalelo
Data Structure · Q624

Miscellaneous on Data Structures

Programming · Data Structure · question 624

Q624

What is the output of the following code? #include int get_len(char *s) int len = 0; while(s[len] != '\0') len++; return len; int main() char *s = ""; int len = get_len(s); printf("%d",len); return 0;

A.
0
Answer
B.
1
C.
Runtime error
D.
Garbage value

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board