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 |
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
Write a c program to search an element in an array using recursion
main() { int i=5,j=6,z; printf("%d",i+++j); }
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.
5 Answers IITR, Microsoft, Nike,
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.
void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
How to return multiple values from a function?
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too