|
|||||||||||||
C-Programing Sample test 2 |
|||||||||||||
void print(int **
arr)
{ print(”0 %f, 1 %f, 2 %f “,arr[0][0],arr[0][1],arr[0][2]); } main() { int a[ ][ ]={ {1,2,3}, {4,5,6} } int ** arr=a; print(arr); arr++; print(arr); } (a) 1 2 3 4 5 6 (b) 1 2.0 3.0 4 5.0 6.0 (c) unknown (d) The statements would not compile. void func(void)
{ char string [ ] = "This is a string"; } (a) stack (b) heap (c) code or text segment as per implementation (d) created when func is called, stored in function stack space and destroyed as it goes out. {
int i=6; int *p=&i; free(p); printf(”%d”,i); } (a) No Error (b) Free can’t be used for p (c) Compiler Error (d) In printf we should use *p instead of i. main()
{ int i=5; i=!i>3; printf(”%d”,i); } (a) 0 (b) 5 (c) 3 (d) Error |
|||||||||||||
| Contributed by: www.knoowgle.com | |||||||||||||
| Copyright 2006 knoowgle.com |