Question 61
What is the output of the code given below?
#include <stdio.h>
int main()
{
char name[]="satellites";
int len;
int size;
len= strlen(name);
size = sizeof(name);
printf("%d",len*size);
return 0;
}Step-by-Step Solution
Detailed Explanation:
strlen("satellites") = 10.
sizeof("satellites") = 11 (includes null terminator '\0').
len * size = 10 * 11 = 110.