C
Q. What will be the output of the following C code?
#include <stdio.h> int main() { char str1[] = { 'H', 'e', 'l', 'l', 'o' }; char str2[] = "Hello"; printf("%ld,%ld", sizeof(str1), sizeof(str2)); return 0; }
str1 is initialized with the characters and there are only 5 characters. Thus, the length of the str is 5. While, str2 is initialized with the string "Hello", when we initialized the string in this way - a null ('\0') character is inserted after the string. Thus, the length of str2 is 6.
You must be Logged in to update hint/solution
Q. What is the output of the following code snippet?
Q. Right Shift operation >> is equivalent to ?
Q. What is the output of C Program.?
Q. What will be output of the following c code?
Q. If a C program contains only one function, it must be
Q. In C language a << 1 is equivalent to
Q. What is the output of C Program with functions.?
Q. What is the similarity between enum and struct ?
Discusssion
Login to discuss.