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: What does agonise me most is not this criticism, but the trivial reason behind it.

A I most agonised

B agonises me most

C No correction required

D most agonising me

E agonising me most

Q2: What will be the output of the program assuming that the array begins at location 1002?
#include<stdio.h>

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

A 1002, 2004, 4008, 2

B Error

C 1002, 1002, 1002, 1

D 2004, 4008, 8016, 1

Q3: What will be the output of the program ?
#include<stdio.h>
power(int**);
int main()
{
    int a=5, *aa; /* Address of 'a' is 1000 */
    aa = &a;
    a = power(&aa);
    printf("%d\n", a);
    return 0;
}
power(int **ptr)
{
    int b;
    b = **ptr***ptr;
    return (b);
}

A 5

B 125

C 25

D Garbage value

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

int main()
{
    char str1[] = "India";
    char str2[] = "Aptitude";
    char *s1 = str1, *s2=str2;
    while(*s1++ = *s2++)
        printf("%s", str1);

    printf("\n");
    return 0;
}

A (null)

B India

C AptitudeCrack

D BndiaBIdiaAptitudeia

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

int main()
{
    int i, n;
    char *x="Alice";
    n = strlen(x);
    *x = x[n];
    for(i=0; i<=n; i++)
    {
        printf("%s ", x);
        x++;
    }
    printf("\n", x);
    return 0;
}

A lice ice ce e

B ecilA

C Alice lice ice ce e

D Alice

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

int main()
{
    int i, a[] = {2, 4, 6, 8, 10};
    change(a, 5);
    for(i=0; i<=4; i++)
        printf("%d, ", a[i]);
    return 0;
}
void change(int *b, int n)
{
    int i;
    for(i=0; i<n; i++)
        *(b+1) = *(b+i)+5;
}

A 2 4 6 8 10

B 2, 15, 6, 8, 10

C 7, 9, 11, 13, 15

D 3, 1, -1, -3, -5

Q7: If the size of integer is 4bytes, What will be the output of the program?
#include<stdio.h>

int main()
{
    int arr[] = {12, 13, 14, 15, 16};
    printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0]));
    return 0;
}

A 20, 2, 2

B 20, 4, 4

C 16, 2, 2

D 10, 2, 4

Q8: Point out the compile time error in the program given below.
#include<stdio.h>

int main()
{
    int *x;
    *x=100;
    return 0;
}

A Error: suspicious pointer conversion

B Error: invalid assignment for x

C None of above

D No error

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

int main()
{
    int a[] = {10, 20, 30, 40, 50};
    int j;
    for(j=0; j<5; j++)
    {
        printf("%d\n", a);
        a++;
    }
    return 0;
}

A Error: LValue required

B Error: Expression syntax

C Error: Declaration syntax

D Error: Rvalue required

Q10: Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?

A float *fun(float**);

B float **fun(float***);

C float ****fun(float***);

D float fun(float***);