C and DS Previous BITS of JNTUH 1st Year




I. Choose the correct alternative:
1. If you don’t initialize a static array, what would be the elements set to?                  [    ]
a) 0           b) an known value            c) 1                             d) the character constant ‘\0’
2. The amount of storage required for holding elements of the array depends on       [    ]
a) size           b) data type                     c) data type & size                d) Runtime requirement
3. How many values a function can return at a time                                                    [    ]
a) 2                     b) any number of values                c) only 1              d) no values 0
4. In which parameter passing mechanism, actual argument values are unchanged?   [    ]
a) By value         b) by value reference     c) by name                  d) by reference
5. The statement : printf (“%d”, size of(“”)); prints                                                     [    ]
a) zero             b) 1                 c) garbage                               d) an error message
6. One structure cannot be a member of                                                                      [     ]
a) some other structure            b) an array                   c) a union                    d) the same structure
7. The type of any pointer is :                                                                                      [     ]
a) integer data type      b) character data type c) unsigned integer data type   d) none of these
8. Which of the following is wrong with respect to functions                                      [      ]
a) it facilitates the top-down modular programming  b) function will provide reusability of the code
c) a function will always return some value               d)reduce the length of the program
9. Structure is a data type whose members are                                                                          [     ]
a) all different data types                     b) all same data types
c) may be different or same                  d) no element is defined
10. s[2][1] is same as                                                                                                   [     ]
a) *((s+2)+1)                b) *((s+2)*1)              c) *(*s+2)+1)               d) (*(s+2)+1)

II Fill in the blanks
11. _________is the standard library function is used to reverse the given string
12. The parameters in a function definition are called as ____________ parameters
13. ______________ input/output function is used for reading a string having multiple words
14. The pointer stores ____________of a variable
15. If one or more members are pointer to the same structure, the structure is known as ________
Structure
16. The array elements always stored in ___________memory locations
17. The ___________function is used to allocate block of memory
18. ______________is collection o f dissimilar data items
19. ____________is programming technique that allows the programmer to express operations in terms of themselves
20. _____________is a collection is related information that is permanently stored on the disk.




I. Choose the correct alternative
1. struct a                                                                                                                     [    ]
{
int I;
float j;
};
Which of the following syntax is correct to declare a structure variable
A. struct union a;                     B. union struct a;                     C. union a t;                 D. struct a t;
2. Which of the following is used with printf ( ) function for printing the Address of a variable [    ]
A. %d                                      B. %u                                      C. %f                           D. %c
3. struct{ int I;                                                                                                              [      ]
flaot j;} s; sizeof (s) will be
A. 4 bytes                                B. 2 bytes                                C. 6 bytes                    D. 0 bytes
4. The process of calling a function using pointers to pass the address of variables is known as [    ]
A. call by argument                 B. call by parameter                C. call by value            D. call by reference
5. main( )                                                                                                                     [    ]
{
int a=5,b,*c;c=&a;b=*c;
printf("\n value of a=%d & b=%d",a,b,)}
A. a=3,b=3                               B. a=4,b=4                  C. a=6,b=6                  D. a=5,b=5
6. main( )                                                                                                                     [     ]
{
char *str1="abcd";
char str2[ ]="abcd";
printf ("%d%d%d", sizeof(str1),sizeof(str2),sizeof("abcd"));
}
A. 2 5 5                                   B. 5 5 2                       C. Compiler error                                 D. 5 2 5
7. A block of memory is allocated using the function [ ]
A. falloc( ) B. dalloc( ) C. malloc( ) D. calloc( )
8. In union all members use                                                                             [     ]
A. no location                          B. same location                      C. different location    D. no stroage
9. Which of the following storage classes is used to allocate memory in cpu registers [    ]
A. auto                         B. register                   C. static                        D. extern
10. If we declare an array like int a[4] = {1, 2, 3, 4, 5} then                            [     ]
A. results in compilation error             B. valid but skip the last value 5.
C. valid but skip the first value 1          D. Initializes all values of array with 0
II Fill in the blanks
11. The standard library function strcmp (“JNTUH”, “JNTUK”) retruns ____________
12. The general format of realloc function is ___________
13. Structure elements can be accessed through a pointer to a structure using the operator ____________
14. Self referential structure means __________________
15. A program obtaining its memory while it is running is called as ___________.
16. The name of the array refers to ___________ address
17. In command line arguments program the first argument of the main function Indicates _________
18. In enum wd={SUN, MON, TUE=5, WED, THU, FRI, SAT}, The value Assigned to enum constant FRI is __________
19. Pointers ________ the execution speed (increased/decrease)
20. Pre Processing statements are started with ________ symbol

Followers