416 views
1 votes
1 votes
#include <stdio.h>
#include <string.h>

void fun(char *arr)
{
int i;
unsigned int n = strlen(arr);
printf("n = %d\n", n);
for (i=0; i<n; i++)
    printf("%c ", arr[i]);
}

// Driver program
int main()
{
char arr[] = {'s', 'i', 'd', 'd', 'i', 's', 's', 'i', 'd'};
fun(arr);
return 0;
}

out put of the following code ?

answer given n=11

siddissidj@

doubt why strlen is 11 , is it not 9 ? which 2 character are extra ....

someone give detail explaination

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
Md Sazzad asked Dec 23, 2023
131 views
How many strings are there of lowercase letters of length four or less, not counting the empty string?
0 votes
0 votes
2 answers
4
Sambit Kumar asked Sep 9, 2018
921 views
An n-bit binary string is selected uniformly at random.For a k $\geq$ 1,what is the probability of selecting an n-bit string in which there is a substring of length at le...