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: They felt humiliated because they realised that they had cheated.

A were to be cheated

B had been cheating

C have been cheated

D No correction required

E had been cheated

Q2:
Point out the error in the following program (if it is compiled with Turbo C compiler).
#include<stdio.h>
int main()
{
    display();
    return 0;
}
void display()
{
    printf('AptitudeCrack.com');
}

A
display() doesn't get invoked

B None of these

C No error

D
display() is called before it is defined

Q3: Point out the error in the program?
#include<stdio.h>

int main()
{
    struct bits
    {
        float f:2;
    }bit;

    printf('%d\n', sizeof(bit));
    return 0;
}

A
Error: cannot set bit field for float

B 4

C Error: Invalid member access in structure

D 2

Q4: Point out the error in the program?
#include<stdio.h>

int main()
{
    struct emp
    {
        char name[25];
        int age;
        float bs;
    };
    struct emp e;
    e.name = 'Suresh';
    e.age = 25;
    printf('%s %d\n', e.name, e.age);
    return 0;
}

A Error: invalid constant expression

B Error: Rvalue required

C Error: Lvalue required/incompatible types in assignment

D No error, Output: Suresh 25

Q5: Which of the following statements correct about the below program?
#include<stdio.h>

int main()
{
    struct emp
    {
        char name[25];
        int age;
        float sal;
    };
    struct emp e[2];
    int i=0;
    for(i=0; i<2; i++)
        scanf('%s %d %f', e[i].name, &e[i].age, &e[i].sal);

    for(i=0; i<2; i++)
        scanf('%s %d %f', e[i].name, e[i].age, e[i].sal);
    return 0;
}

A Error: structure variable must be initialized.

B Error: Floating point formats not linked Abnormal program termination.

C The code runs successfully.

D Error: scanf() function cannot be used for structures elements.

Q6: Which of the following statements correct about the below program?
#include<stdio.h>

int main()
{
    union a
    {
        int i;
        char ch[2];
    };
    union a u1 = {512};
    union a u2 = {0, 2};
    return 0;
}
1: u2 CANNOT be initialized as shown.
2: u1 can be initialized as shown.
3: To initialize char ch[] of u2 '.' operator should be used.
4: The code causes an error 'Declaration syntax error'

A 2, 3

B 1, 3, 4

C 1, 2

D 1, 2, 3

Q7: Which of the following statements correctly assigns 12 to month using pointer variable pdt?
#include<stdio.h>

    struct date
    {
        int day;
        int month;
        int year;
    };
int main()
{
    struct date d;
    struct date *pdt;
    pdt = &d;
    return 0;
}

A d.month = 12

B pdt.month = 12

C &pdt.month = 12

D pdt->month = 12

Q8:
Which of the following statements correct about the below code?
maruti.engine.bolts=25;

A Structure maruti is nested within structure bolts.

B Structure maruti is nested within structure engine.

C Structure engine is nested within structure maruti.

D Structure bolts is nested within structure engine.

Q9: A union cannot be nested in a structure

A False

B True

Q10: Nested unions are allowed

A True

B False