int DIM(int array[])
{
return sizeof(array)/sizeof(int );
}
main()
{
int arr[10];
printf(“The dimension of the array is %d”, DIM(arr));
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
1
Explanation:
Arrays cannot be passed to functions as arguments and only
the pointers can be passed. So the argument is equivalent to
int * array (this is one of the very few places where [] and
* usage are equivalent). The return statement becomes,
sizeof(int *)/ sizeof(int) that happens to be equal in this
case.
Is This Answer Correct ? | 9 Yes | 2 No |
Answer / manoj kumar
Arrays cannot be passed to functions as arguments and only
the pointers can be passed.
Is This Answer Correct ? | 3 Yes | 0 No |
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10
why the range of an unsigned integer is double almost than the signed integer.
main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4
18 Answers HCL, IBM, Infosys, LG Soft, Satyam,
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
Program to find the largest sum of contiguous integers in the array. O(n)
WAP to display 1,2,3,4,5........N
Find your day from your DOB?
15 Answers Accenture, Microsoft,
main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
Develop a routine to reflect an object about an arbitrarily selected plane
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024