#include<stdio.h>
main()
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d----%d",*p,*q);
}
Answer / susie
Answer :
SomeGarbageValue---1
Explanation:
p=&a[2][2][2] you declare only two 2D arrays,
but you are trying to access the third 2D(which you are not
declared) it will print garbage values. *q=***a starting
address of a is assigned integer pointer. Now q is pointing
to starting address of a. If you print *q, it will print
first element of 3D array.
| Is This Answer Correct ? | 1 Yes | 0 No |
main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }
What is your nationality?
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
How to palindrom string in c language?
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O