Post-Test
- What is the output of C Program with Strings.?
- How do you convert this char array to string.?
char str[]={'g','l','o','b','y'}; - What is the output of C Program?
- What is the output of C Program with arrays.?
- What is the maximum length of a C String.?
int main()
{
char str[]={'g','l','o','b','y','\0'};
printf("%s",str);
return 0;
}
/
g
globe
globe\0
Compiler error
str[5] = 0;
str[5] = '\0'
str[]={'g','l','o','b','y','\0'};
All the above
int main()
{
int str[]={'g','l','o','b','y'};
printf("A%c ",str);
printf("A%s ",str);
printf("A%c ",str[0]);
return 0;
}
A Ag Ag
A*randomchar* Ag Ag
Compiler error
int main()
{
char str[]={"C","A","T","\0"};
printf("%s",str);
return 0;
}
CAT
CAT\0
Compile error
32 characters
64 Characters
256 characters
None of the above
