< Back to Tests


C (Basic Test 1)

1.  In the given below code, the P2 is
Typedef int *ptr;
ptr P1, P2;

Integer
Integer Pointer
Both, Integer & Integer pointer
None of above

2. In which stage the following code #include<stdio.h> gets replaced by the contents of the file stdio.h

During linking
During execution
During preprocessing
During editing

3. How will you print \n on the screen ?

printf("\n");
echo "\\n";
printf('\n');
printf("\\n");

4. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

The element will be set to 0.
The compiler would report an error
The program may crash if some important data gets overwritten
The array size would appropriately grow.

5. A pointer to a block of memory is effectively same as an array

TRUE
FALSE

6. Does array name gives the base address ?

TRUE
FALSE

7. Which bitwise operator is suitable for turning off a particular bit in a number?

&& operator
& operator
|| operator
! Operator

8. Which bitwise operator is suitable for turning on a particular bit in a number?

&& operator
& operator
|| operator
| Operator

9. The keyword used to transfer control from a function back to the calling function is

switch
goto
go back
return

10.
#include "stdio.h"
int main()
{
    char arr[100];
    printf("%d", scanf("%s", arr));
    /* Suppose that input value given
        for above scanf is "BreakInterview" */
    return 1;
}

14
1
100
15