Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Pointers
What will be the output of the program? #include
int main() { static char *s[] = {"black", "white", "pink", "violet"}; char **ptr[] = {s+3, s+2, s+1, s}, ***p; p = ptr; ++p; printf("%s", **p+1); return 0; }
ink
ack
ite
let
Correct Answer:
ink
← Previous Question
Next Question→
More Questions from
Pointers
What will be the output of the program? #include
int *check(static int, static int); int main() { int *c; c = check(10, 20); printf("%d\n", c); return 0; } int *check(static int i, static int j) { int *p, *q; p = &i; q = &j; if(i >= 45) return (p); else return (q); }
What will be the output of the program? #include
int main() { void *vp; char ch=74, *cp="JACK"; int j=65; vp=&ch; printf("%c", *(char*)vp); vp=&j; printf("%c", *(int*)vp); vp=cp; printf("%s", (char*)vp+2); return 0; }
In the following program add a statement in the function fact() such that the factorial gets stored in j. #include
void fact(int*); int main() { int i=5; fact(&i); printf("%d\n", i); return 0; } void fact(int *j) { static int s=1; if(*j!=0) { s = s**j; *j = *j-1; fact(j); /* Add a statement here */ } }
Which of the statements is correct about the program? #include
int main() { float a=3.14; char *j; j = (char*)&a; printf("%d\n", *j); return 0; }
Which of the statements is correct about the program? #include
int main() { int arr[3][3] = {1, 2, 3, 4}; printf("%d\n", *(*(*(arr)))); return 0; }
Which statement will you add to the following program to ensure that the program outputs "CuriousTab" on execution? #include
int main() { char s[] = "CuriousTab"; char t[25]; char *ps, *pt; ps = s; pt = t; while(*ps) *pt++ = *ps++; /* Add a statement here */ printf("%s\n", t); return 0; }
In the following program add a statement in the function fun() such that address of a gets stored in j? #include
int main() { int *j; void fun(int**); fun(&j); return 0; } void fun(int **k) { int a=10; /* Add a statement here */ }
Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?
Which of the following statements correct about k used in the below statement? char ****k;
Which of the statements is correct about the program? #include
int main() { int i=10; int *j=&i; return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments