Question 8899 – ISRO CS 2020
December 26, 2023Question 8904 – ISRO CS 2020
December 26, 2023Question 8901 – ISRO CS 2020
What is the output of the code given below?
#include
int main()
{
char name[ ]=”satellites”;
int len;
int size;
len = strlen (name);
size = sizeof(name);
printf(“%d”, len * size);
return 0;
}
Correct Answer: B
Question 30 Explanation:
strlen(name) = 10
sizeof(name)=11 // including \0 at the end which is by default for char array in C.
len*size=10 * 11 = 110
sizeof(name)=11 // including \0 at the end which is by default for char array in C.
len*size=10 * 11 = 110
100
110
40
44
Subscribe
Login
0 Comments