What will be the output of the following code snippet? #include int main() { char str1[] = “Hello”; char str2[] = “World”; char str3[12]; sprintf(str3, “%s %s”, str1, str2); printf(“%s\n”, str3); return 0; }
Blog
What will be the output of the following code snippet? #inc…
What will be the output of the following code snippet? #include struct point { int x; int y; }; void doSomething(struct point *p) { p->x = 10; p->y = 20; } int main() { struct point p = {1, 2}; doSomething(&p); printf(“%d %d\n”, p.x, p.y); return 0; }
What is the purpose of the following code snippet? #include…
What is the purpose of the following code snippet? #include int doSomething(char *str) { int i = 0; while (*str++) { i++; } return i; } int main() { char str[] = “Hello”; printf(“%d\n”, doSomething(str)); return 0; }
The function fscanf writes formatted output to a file.
The function fscanf writes formatted output to a file.
How do you return a structure from a function?
How do you return a structure from a function?
How do you pass a structure to a function?
How do you pass a structure to a function?
Which function is used to check for the end of a file?
Which function is used to check for the end of a file?
The function fread reads a block of data from a file.
The function fread reads a block of data from a file.
Structures can be passed to functions by value only.
Structures can be passed to functions by value only.
The function fgets reads a line of text from the standard in…
The function fgets reads a line of text from the standard input.