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

B If I have had

C In case I would have

D Had I been

E No correction required

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
Error: in int(*p)() = fun;

B
Error: fun() prototype not defined

C None of these

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 Integer pointer

B Integer

C Error in declaration

D None of above

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

A P is a constant

B None of above

C P is character type

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 an array of three pointer

B x is an array of three function pointers

C Error in x declaration

D x is a pointer

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 2

C red

D 0

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, 72.000000

C 72.000000, 68

D 68.000000, 72.000000

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 0

B 90

C 90.000000

D 9