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: We can not always convey ourselves in simple sentences.

A can not always communicate

B cannot always express

C cannot always convey

D can not always express

E No correction required

Q2: How would you round off a value from 1.66 to 2.0?

A ceil(1.66)

B floor(1.66)

C roundup(1.66)

D roundto(1.66)

Q3: What will be the output of the program ?
#include<stdio.h>
int *check(static int, static int);

int main()
{
    int *c;
    c = check(10, 20);
    printf("%d\n", c);
    return 0;
}
int *check(static int i, static int j)
{
    int *p, *q;
    p = &i;
    q = &j;
    if(i >= 45)
        return (p);
    else
        return (q);
}

A Error: cannot use static for function parameters

B Error: Non portable pointer conversion

C 20

D 10

Q4: What will be the output of the program if the size of pointer is 4-bytes?
#include<stdio.h>

int main()
{
    printf("%d, %d\n", sizeof(NULL), sizeof(""));
    return 0;
}

A 2, 2

B 2, 1

C 4, 2

D 4, 1

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

int main()
{
    void *vp;
    char ch=74, *cp="JACK";
    int j=65;
    vp=&ch;
    printf("%c", *(char*)vp);
    vp=&j;
    printf("%c", *(int*)vp);
    vp=cp;
    printf("%s", (char*)vp+2);
    return 0;
}

A JCK

B JACK

C JAK

D J65K

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

int main()
{
    int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8};
    int *p, *q;
    p = &arr[1][1][1];
    q = (int*) arr;
    printf("%d, %d\n", *p, *q);
    return 0;
}

A 8, 10

B 8, 1

C Garbage values

D 10, 2

Q7: What will be the output of the program assuming that the array begins at the location 1002 and size of an integer is 4 bytes?
#include<stdio.h>

int main()
{
    int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
    printf("%u, %u, %u\n", a[0]+1, *(a[0]+1), *(*(a+0)+1));
    return 0;
}

A 448, 4, 4

B Error

C 520, 2, 2

D 1006, 2, 2

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

int main()
{
    int arr[3] = {2, 3, 4};
    char *p;
    p = arr;
    p = (char*)((int*)(p));
    printf("%d, ", *p);
    p = (int*)(p+1);
    printf("%d", *p);
    return 0;
}

A 2, 0

B 0, 0

C 2, Garbage value

D 2, 3

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

int main()
{
    char *str;
    str = "%d\n";
    str++;
    str++;
    printf(str-2, 300);
    return 0;
}

A 30

B No output

C 3

D 30

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

int main()
{
    printf("%c\n", 7["AptitudeCrack"]);
    return 0;
}

A print "X" of AptitudeCrack

B Error: in printf

C Nothing will print

D print "7"