image not found

Oops! That page can't be found.


Directions to Solve

Which of phrases given below each sentence should replace the phrase printed in bold type to make the grammatically correct? If the sentence is correct as it is, mark 'E' as the answer.

Q1: If I would have realised the nature of job earlier, I would not have accepted it.

A Had I been

B No correction required

C Had I

D In case I would have

E If I have had

Q2:
Point out the error in the following program.
#include<stdio.h>
int main()
{
    int (*p)() = fun;
    (*p)();
    return 0;
}
int fun()
{
    printf('AptitudeCrack.com\n');
    return 0;
}

A None of these

B
Error: fun() prototype not defined

C
Error: in int(*p)() = fun;

D No error

Q3: Does there exist any way to make the command-line arguments available to other functions without passing them as arguments to the function?

A No

B Yes

Q4: In the following code, the P2 is Integer Pointer or Integer?
typedef int *ptr;
ptr p1, p2;

A None of above

B Integer

C Error in declaration

D Integer pointer

Q5: In the following code what is 'P'?
typedef char *charp;
const charp P;

A P is a constant

B P is character type

C None of above

D P is a character constant

Q6: What is x in the following program?
#include<stdio.h>

int main()
{
    typedef char (*(*arrfptr[3])())[10];
    arrfptr x;
    return 0;
}

A x is a pointer

B x is an array of three function pointers

C x is an array of three pointer

D Error in x declaration

Q7: What will be the output of the program?
#include<stdio.h>

int main()
{
    enum color{red, green, blue};
    typedef enum color mycolor;
    mycolor m = red;
    printf('%d', m);
    return 0;
}

A 1

B 0

C 2

D red

Q8: What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef int arr[5];
    arr iarr = {1, 2, 3, 4, 5};
    int i;
    for(i=0; i<4; i++)
        printf('%d,', iarr[i]);
    return 0;
}

A 1, 2, 3, 4

B 1, 2, 3, 4, 5

C No output

D Error: Cannot use typedef with an array

Q9: What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef int LONG;
    LONG a=4;
    LONG b=68;
    float c=0;
    c=b;
    b+=a;
    printf('%d,', b);
    printf('%f\n', c);
    return 0;
}

A 72, 68.000000

B 68.000000, 72.000000

C 68, 72.000000

D 72.000000, 68

Q10: What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef float f;
    static f *fptr;
    float fval = 90;
    fptr = &fval;
    printf('%f\n', *fptr);
    return 0;
}

A 9

B 90.000000

C 90

D 0