c language

(10)Identify the true statement

 

(a)Memory allocated by an array can be deallocated using free() function  

(b)C also supports zero length array

(c)Array can be used to hold dissimilar kinds of data 

(d)Working beyond array size is risky   

 (11)Which is true about array? 

(a)Array can be dynamic  

(b)Using malloc memory can be allocated for array during run time  

(c)Unused memory can’t be used at the time of  requirement   

(d)None of  these

 (12)The function strstr()  returns 

(a)Length of the initial substring  

(b)Pointer to the first occurrence of the string   

(c)Pointer to the next token in the string 

(d)Pointer to the last occurrence of the string

 (13)Find the correct output

void main()

{

       int a[]={1,2,3,4,5},k=1;

       while(k<=5)

       {

     printf(“%d”,k[a-1]);

     k++;

       }

}  

(a)Compilation error  

(b)Runtime error 

(c)1 2 3 4 5  

(d)5 4 3 2 1  

 (14)Which of  the following operation is legal with the array a?  

(a)a++

(b)a+1

(c)++a

(d)a*2

No comments: