#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 |
What is the hidden bug with the following statement? assert(val++ != 0);
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
Write a routine that prints out a 2-D array in spiral order
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4