#include
main( )
{int n;if(n<=-1)
{int x=1else
{
int x=1;
}a) Compiler error b) Unpredictable output c) 10 d) 1
11. The correct declaration of a pointer “func” to function returning a “char” and taking no parameters is
a) char func( )* func;
b) char (*func)( );
c) char* ( ) func;
d) None of the above
12. The output of the following program is
#include
#define arbit 5
main( )
{printf(“%d\n”,arbit}
a) 5 b) 6 c) Compiler error d) Runtime error
13. Determine which of the following are valid identifiers
i. Return
ii.123 45 6789
iii. Record_1
iv. $Tax
a) iii & iv b) i & iii c) i,ii & iv d) i & iv
14. The output of the following program is
#include
struct x {int a; char *b;} *p;
main( )
p=(struct x*) 100;
printf(‘%d,%d,%d\n”,p,p+1,&p[2]);
a) 100,108,116 b) Compilation error c) 100,104,108 d) 100,103,106
15. What is the output of the following?
main( )
int a[5]={5,1,15,20,25};
int i=1;
printf(“\n%d%d”,a[i]++,a[++i]);
a) 2,16 b) 1,15 c) 1,20 d) 2,1
16. What is the output of the following
main( )
int a[5]={5,1,15,20,25};
int i=1;
printf(“\n%d%d”,a[i],a[i++i]);
a) 2,16 b) 1,15 c) 1,20 d) 2,16
16. static float table [2][3]={{1,1,1,2,1,3},{2,1,2,2,2,3}};
What is the value of *(*(table)+1)+1?
a) 2,2 b)1,2 c) 2,1 d) 2,3
17. What is the output of the following program?
#include
main( )
int i,j,x=0;
for(i=0;i<5;++i)
for(j=0;j < i ;++j)
x+=(i+j-1);
printf(“%d”,x);
break;
a) 1 b) 0 c) 2 d) None of the above
18. Consider the following
i. Pointer to a function that accepts 3 integer arguments and returns a floating-point quantity
float(8pf)(int a, int b,int c)
ii. Pointer to a function that accepts 3 pointers to integer quantities as arguments an returns a pointer to a floating-point quantity
float *(*pf)(int *a,int *b,int *c);
a) i is true, ii is true b) i is true,ii is false
c) i is false, ii is false d) i is false, ii is true
19. Consider the following statements
i. An integer quantity can be added to or subtracted from a pointer variables.
ii. Two pointer variables can be added.
iii. A pointer variable can be multiplied by a constant
iv. Two pointer variables of same type can be subtracted.
a) Only ii & iv are true b) Only iii is false c) Only ii is false d) Only i & ii are true
20. If p is a pointer ,what does p[i] mean?
a) Same as *(*p+i)
b) Same as *(p+i)
c) Same as *p+i
d) None of the above